]> source.dussan.org Git - aspectj.git/commitdiff
tests for 159268, 235505, 64222 (all parser related)
authoraclement <aclement>
Tue, 10 Jun 2008 18:52:11 +0000 (18:52 +0000)
committeraclement <aclement>
Tue, 10 Jun 2008 18:52:11 +0000 (18:52 +0000)
tests/bugs161/pr159268/C.java [new file with mode: 0644]
tests/bugs161/pr235505/A.java [new file with mode: 0644]
tests/bugs161/pr235505/B.java [new file with mode: 0644]
tests/bugs161/pr64222/C.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml

diff --git a/tests/bugs161/pr159268/C.java b/tests/bugs161/pr159268/C.java
new file mode 100644 (file)
index 0000000..c2c4d3f
--- /dev/null
@@ -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 (file)
index 0000000..154cc56
--- /dev/null
@@ -0,0 +1,2 @@
+public privileged abstract aspect A<T> {
+}
diff --git a/tests/bugs161/pr235505/B.java b/tests/bugs161/pr235505/B.java
new file mode 100644 (file)
index 0000000..f06802c
--- /dev/null
@@ -0,0 +1,16 @@
+privileged abstract aspect A<T> {
+  public void foo(T t) { System.out.println(t); }
+  before(T t): execution(* *(..)) && args(t) && !within(A+) { foo(t); }
+}
+
+aspect X extends A<String> {}
+
+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 (file)
index 0000000..f7c3c40
--- /dev/null
@@ -0,0 +1,9 @@
+class C {
+       int dummy() {return 5;}
+}
+
+aspect Foo {
+       around(): call(int C.dummy()) {
+               proceed();
+       }
+}
index 34db793c23063086fd49c5f290498268a85f50f7..ec13e0260eec63cd66626f0a8c17c5e9b4169231 100644 (file)
@@ -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");}
index 1eac07abaafec008c0ee15f3d4f34f44f39c3670..9f5c8fbca27806ce4c0b2f5de06c65a6568d116c 100644 (file)
         <compile files="BarAspect.aj Foo.java Bar.java" options="-1.5"/>
         <compile files="BarAspect.aj Bar.java Foo.java" options="-1.5"/>
     </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr235505" title="privileged generic aspect">
+        <compile files="A.java" options="-1.5"/>
+    </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr235505" title="privileged generic aspect - 2">
+        <compile files="B.java" options="-1.5"/>
+        <run class="B">
+          <stdout>
+            <line text="Hello World"/>
+            <line text="Hello World"/>
+          </stdout>
+        </run>
+    </ajc-test> 
+    
+    <ajc-test dir="bugs161/pr64222" title="parsing around advice no return">
+        <compile files="C.java" options="-1.5">
+          <message kind="error" line="6" text="to complete around advice declaration"/>
+        </compile>
+    </ajc-test> 
+
+    <ajc-test dir="bugs161/pr159268" title="before array name">
+        <compile files="C.java" options="-1.5"/>
+    </ajc-test> 
+    
+    
 
 </suite>
\ No newline at end of file