Mirror von
https://github.com/eclipse-aspectj/aspectj.git
synchronisiert 2024-08-27 05:54:38 +02:00
27 Zeilen
487 B
Java
27 Zeilen
487 B
Java
import org.aspectj.testing.*;
|
|
|
|
privileged aspect PrivilegedAspect {
|
|
public void OtherClass.foo() {
|
|
Tester.event("foo.intro");
|
|
}
|
|
}
|
|
|
|
class OtherClass {
|
|
}
|
|
|
|
public class Privileged {
|
|
public static void main(String[] args) {
|
|
new Privileged().go();
|
|
}
|
|
|
|
static {
|
|
Tester.expectEventsInString("foo.intro,foo.done,foo.called");
|
|
}
|
|
|
|
void go() {
|
|
Tester.event("foo.called");
|
|
new OtherClass().foo();
|
|
Tester.event("foo.done");
|
|
}
|
|
}
|