aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/PreInitialization.java
blob: a4e447667ce69bc08aa218e9d41d6795067977a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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");
    }
}