From 58961143f7f8e28243a9ae58cd89b25ee14b318d Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 10 Jun 2008 18:52:11 +0000 Subject: [PATCH] tests for 159268, 235505, 64222 (all parser related) --- tests/bugs161/pr159268/C.java | 8 ++++++ tests/bugs161/pr235505/A.java | 2 ++ tests/bugs161/pr235505/B.java | 16 ++++++++++++ tests/bugs161/pr64222/C.java | 9 +++++++ .../systemtest/ajc161/Ajc161Tests.java | 4 +++ .../org/aspectj/systemtest/ajc161/ajc161.xml | 26 +++++++++++++++++++ 6 files changed, 65 insertions(+) create mode 100644 tests/bugs161/pr159268/C.java create mode 100644 tests/bugs161/pr235505/A.java create mode 100644 tests/bugs161/pr235505/B.java create mode 100644 tests/bugs161/pr64222/C.java diff --git a/tests/bugs161/pr159268/C.java b/tests/bugs161/pr159268/C.java new file mode 100644 index 000000000..c2c4d3f9b --- /dev/null +++ b/tests/bugs161/pr159268/C.java @@ -0,0 +1,8 @@ +public class C { + + public static void main(String []argv) { + Object[] before; + before = new Object[10]; + before[0].toString(); // Eclipse: Syntax error on token "before", invalid + } +} diff --git a/tests/bugs161/pr235505/A.java b/tests/bugs161/pr235505/A.java new file mode 100644 index 000000000..154cc56e3 --- /dev/null +++ b/tests/bugs161/pr235505/A.java @@ -0,0 +1,2 @@ +public privileged abstract aspect A { +} diff --git a/tests/bugs161/pr235505/B.java b/tests/bugs161/pr235505/B.java new file mode 100644 index 000000000..f06802c13 --- /dev/null +++ b/tests/bugs161/pr235505/B.java @@ -0,0 +1,16 @@ +privileged abstract aspect A { + public void foo(T t) { System.out.println(t); } + before(T t): execution(* *(..)) && args(t) && !within(A+) { foo(t); } +} + +aspect X extends A {} + +public class B { + public static void main(String []argv) { + new B().run("Hello World"); + } + + public void run(String s) { + System.out.println(s); + } +} diff --git a/tests/bugs161/pr64222/C.java b/tests/bugs161/pr64222/C.java new file mode 100644 index 000000000..f7c3c4024 --- /dev/null +++ b/tests/bugs161/pr64222/C.java @@ -0,0 +1,9 @@ +class C { + int dummy() {return 5;} +} + +aspect Foo { + around(): call(int C.dummy()) { + proceed(); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java index 34db793c2..ec13e0260 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java @@ -27,6 +27,10 @@ public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testComplexBoundsGenericAspect_pr199130_1() { runTest("complex bounds on generic aspect - 1");} public void testComplexBoundsGenericAspect_pr199130_2() { runTest("complex bounds on generic aspect - 2");} public void testComplexBoundsGenericAspect_pr199130_3() { runTest("complex bounds on generic aspect - 3");} + public void testPrivilegedGenericAspect_pr235505() { runTest("privileged generic aspect");} + public void testPrivilegedGenericAspect_pr235505_2() { runTest("privileged generic aspect - 2");} + public void testParsingAroundNoReturn_pr64222() { runTest("parsing around advice no return");} + public void testParsingBeforeArrayRef_pr159268() { runTest("before array name");} public void testGenericAspectAroundAdvice_pr226201() { runTest("generic aspect around advice");} public void testCrazyGenericsInnerTypes_pr235829() { runTest("crazy generics and inner types");} public void testAnnotationExposureGenerics_pr235597() { runTest("annotation exposure and generics");} diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml index 1eac07aba..9f5c8fbca 100644 --- a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml +++ b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml @@ -154,5 +154,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.39.5