diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/packageAccessPR556 | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/packageAccessPR556')
-rw-r--r-- | tests/new/packageAccessPR556/base1/p/C1.java | 29 | ||||
-rw-r--r-- | tests/new/packageAccessPR556/base2/p/C2.java | 17 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/new/packageAccessPR556/base1/p/C1.java b/tests/new/packageAccessPR556/base1/p/C1.java new file mode 100644 index 000000000..03b6c3c18 --- /dev/null +++ b/tests/new/packageAccessPR556/base1/p/C1.java @@ -0,0 +1,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"); + } +} diff --git a/tests/new/packageAccessPR556/base2/p/C2.java b/tests/new/packageAccessPR556/base2/p/C2.java new file mode 100644 index 000000000..a16dd1fe7 --- /dev/null +++ b/tests/new/packageAccessPR556/base2/p/C2.java @@ -0,0 +1,17 @@ +package p; + +aspect A2 { + private static int privateOne = 1; + static int defaultOne = 1; + protected static int protectedOne = 1; + public static int publicOne = 1; + pointcut p() : within (p..*) ; +} + +class C2 { + private static int privateOne = 1; + static int defaultOne = 1; + protected static int protectedOne = 1; + public static int publicOne = 1; + pointcut p() : within (p..*) ; +} |