mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
27 lines
487 B
Java
27 lines
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");
|
||
|
}
|
||
|
}
|