mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-07-24 22:04:44 +02:00
27 lines
628 B
Java
27 lines
628 B
Java
import org.aspectj.testing.Tester;
|
|
|
|
public class PreInitialization {
|
|
PreInitialization() {
|
|
this(PreInitialization.interestingCall());
|
|
}
|
|
PreInitialization(int ignored) {
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
new PreInitialization();
|
|
Tester.checkEvents(new String[] {"before advice ran"});
|
|
}
|
|
static int interestingCall() {
|
|
// do something interesting
|
|
return 3;
|
|
}
|
|
}
|
|
|
|
aspect A {
|
|
before(): call(int PreInitialization.interestingCall()) {
|
|
Tester.checkEqual(thisEnclosingJoinPointStaticPart.getKind(),
|
|
"preinitialization");
|
|
Tester.event("before advice ran");
|
|
}
|
|
}
|