aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/introductionPackage/one/TestAspect.java
blob: 11e4188b3b6556d8e46b9b8f8d4f1ca656d29ec9 (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
27
28
package one;

import org.aspectj.testing.*;
public aspect TestAspect {
    public static void main(String[] args) {
        C me = new C();
        me.foo();
        Tester.checkAllEvents();
    }
    static {
        Tester.expectEvent("execution(void one.C.publicMethod())");
        Tester.expectEvent("execution(void one.C.protectedMethod())");
        Tester.expectEvent("execution(void one.C.defaultMethod())");
        Tester.expectEvent("get(int one.C.protectedInt)");
        Tester.expectEvent("get(int one.C.publicInt)");
        Tester.expectEvent("get(int one.C.defaultInt)");

        // XXX added - correct?
        Tester.expectEvent("execution(void one.C.foo())");
        Tester.expectEvent("execution(void one.C.protectedMethod())");
    }

    before () : execution(* C.*(..)) || get(int C.*) 
        {
        Tester.event("" + thisJoinPointStaticPart); 
        //System.out.println("" + thisJoinPointStaticPart); 
    }
}