]> source.dussan.org Git - aspectj.git/commitdiff
253109: tests
authoraclement <aclement>
Sun, 2 Nov 2008 19:58:10 +0000 (19:58 +0000)
committeraclement <aclement>
Sun, 2 Nov 2008 19:58:10 +0000 (19:58 +0000)
tests/bugs163/pr253109/CodeOne.java [new file with mode: 0644]
tests/bugs163/pr253109/CodeTwo.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
tests/src/org/aspectj/systemtest/ajc163/ajc163.xml

diff --git a/tests/bugs163/pr253109/CodeOne.java b/tests/bugs163/pr253109/CodeOne.java
new file mode 100644 (file)
index 0000000..0f73cac
--- /dev/null
@@ -0,0 +1,16 @@
+import java.util.*;
+
+public aspect CodeOne {
+  before(): execution(* CodeOne.*(..)) && args(List<Number>) {}
+  before(): execution(* CodeOne.*(..)) && args(List<Integer>) {}
+
+  void m(List<Integer> li) {}
+
+  public void callm() {
+    List<Number> ln = new ArrayList<Number>();
+    List<Integer> li = new ArrayList<Integer>();
+    // m(ln);//not allowed
+    m(li);
+  }
+
+}
diff --git a/tests/bugs163/pr253109/CodeTwo.java b/tests/bugs163/pr253109/CodeTwo.java
new file mode 100644 (file)
index 0000000..ea5a302
--- /dev/null
@@ -0,0 +1,13 @@
+import java.util.*;
+
+public aspect CodeTwo {
+  before(): execution(* CodeTwo.*(..)) && args(List<? extends Number>) {}
+
+  void m(List<Integer> li) {}
+
+  public void callm() {
+    List<? extends Number> lqn = new ArrayList<Number>();
+    // m(lqn);
+  }
+
+}
index 77f2cb55e130986a77f2cccb8cad10f5d6fdf5f1..2c83fd4db29857acc62607602066619a16b5fb9b 100644 (file)
@@ -23,7 +23,15 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
-       public void testBrokenLVT_pr194314_1() {
+       public void testGenericPointcuts_1() {
+               runTest("generic pointcuts - 1");
+       }
+
+       public void testGenericPointcuts_2() {
+               runTest("generic pointcuts - 2");
+       }
+
+       public void testBrokenLVT_pr194314_1() throws Exception {
                runTest("broken lvt - 1");
                JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(), "Service");
                Method[] ms = jc.getMethods();
@@ -57,20 +65,28 @@ public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                System.out.println(m.getLocalVariableTable());
                LocalVariable[] lvt = m.getLocalVariableTable().getLocalVariableTable();
                assertEquals(8, lvt.length);
-               // assertEquals(2, m.getLocalVariableTable().getLocalVariableTable().length);
+               // assertEquals(2,
+               // m.getLocalVariableTable().getLocalVariableTable().length);
 
                // Before I've started any work on this:
-               // LocalVariable(start_pc = 0, length = 68, index = 0:ServiceInterceptorCodeStyle this)
-               // LocalVariable(start_pc = 0, length = 68, index = 1:org.aspectj.runtime.internal.AroundClosure ajc_aroundClosure)
-               // LocalVariable(start_pc = 0, length = 68, index = 2:org.aspectj.lang.JoinPoint thisJoinPoint)
+               // LocalVariable(start_pc = 0, length = 68, index =
+               // 0:ServiceInterceptorCodeStyle this)
+               // LocalVariable(start_pc = 0, length = 68, index =
+               // 1:org.aspectj.runtime.internal.AroundClosure ajc_aroundClosure)
+               // LocalVariable(start_pc = 0, length = 68, index =
+               // 2:org.aspectj.lang.JoinPoint thisJoinPoint)
                // LocalVariable(start_pc = 9, length = 59, index = 3:Object[] args)
                // LocalVariable(start_pc = 21, length = 47, index = 4:long id)
 
                // Method signature:
-               // private static final void method_aroundBody1$advice(Service, long, org.aspectj.lang.JoinPoint,
-               // ServiceInterceptorCodeStyle, org.aspectj.runtime.internal.AroundClosure, org.aspectj.lang.JoinPoint);
+               // private static final void method_aroundBody1$advice(Service, long,
+               // org.aspectj.lang.JoinPoint,
+               // ServiceInterceptorCodeStyle,
+               // org.aspectj.runtime.internal.AroundClosure,
+               // org.aspectj.lang.JoinPoint);
                //
-               // Service, JoinPoint, ServiceInterceptorCodeStyle, AroundClosure, JoinPoint
+               // Service, JoinPoint, ServiceInterceptorCodeStyle, AroundClosure,
+               // JoinPoint
 
                // args should be in slot 7 and the long in position 8
 
index c76014610d9043e6d30b2f166a041bc5402f4c6c..b7ddfa85c077057dc3cdddcdc13256ae8cd98be9 100644 (file)
@@ -3,6 +3,19 @@
 <suite>
 
 
+    <ajc-test dir="bugs163/pr253109" title="generic pointcuts - 1">
+      <compile files="CodeOne.java" options="-1.5">
+        <message kind="warning" line="4" text="has not been applied"/>
+      </compile>
+    </ajc-test>
+    
+    <ajc-test dir="bugs163/pr253109" title="generic pointcuts - 2">
+      <compile files="CodeTwo.java" options="-1.5">
+        <message kind="warning" line="4" text="has not been applied"/>
+      </compile>
+    </ajc-test>
+    
+
     <ajc-test dir="bugs163/pr194314" title="broken lvt - 1">
       <compile files="Service.java IService.java Main.java ServiceInterceptor.java" options="-1.5"/>
     </ajc-test>