summaryrefslogtreecommitdiffstats
path: root/tests/new/packageAccessPR556/base1/p/C1.java
blob: 03b6c3c18b9dbfdbf8c9e6cbd46f3b340a1f11f9 (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
29
package p;

import p.*;
import org.aspectj.testing.Tester;
import org.aspectj.testing.Tester; 

public aspect C1 {
    private static int privateOne = 1 ; //C2.privateOne
    /** @testcase PR#556 aspects get package access to variables in other aspects */
    /** @testcase PR#556 aspects get package access to variables in other classes */
    public static void main(String[] args) {
        int i = C2.defaultOne + C2.protectedOne + C2.publicOne
              + A2.defaultOne + A2.protectedOne + A2.publicOne;
        Tester.expectEvent("C2");
        Tester.expectEvent("A2");
        Tester.check(i==6, "initialization failed: " + i);
        try { System.getProperty("ignore" + i); } 
        catch (Exception e) {} 
        Tester.checkAllEvents();
    }
    /** @testcase class pointcuts visible via package-access from another aspect */
    before () : C2.p() && execution(static void C1.main(String[])) {
        Tester.event("C2");
    }
    /** @testcase aspect pointcuts visible via package-access from another aspect */
    before () : A2.p() && execution(static void C1.main(String[])) {
        Tester.event("A2");
    }
}