]> source.dussan.org Git - aspectj.git/commitdiff
145391: moved tests 152>162 and fixed them
authoraclement <aclement>
Wed, 20 Aug 2008 20:47:14 +0000 (20:47 +0000)
committeraclement <aclement>
Wed, 20 Aug 2008 20:47:14 +0000 (20:47 +0000)
tests/bugs152/pr145391/GenericType.java [deleted file]
tests/bugs152/pr145391/GenericType2.java [deleted file]
tests/bugs162/pr145391/B.class [new file with mode: 0644]
tests/bugs162/pr145391/GenericType.java [new file with mode: 0644]
tests/bugs162/pr145391/GenericType2.java [new file with mode: 0644]
tests/bugs162/pr145391/x/GenericType2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs152/pr145391/GenericType.java b/tests/bugs152/pr145391/GenericType.java
deleted file mode 100644 (file)
index 897e1b7..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-public class GenericType<V extends Integer> {
-
-        public GenericType(V value) {}
-
-        public void foo() {}
-//
-//        public void bar() {}
-
-        protected V getValue() {
-                return null;
-        }
-
-        public static void main(String[] args) {
-                new GenericType<Integer>(null).foo();
-        }
-
-}
-
-aspect SomeAspect {
-        before(GenericType t): call(* GenericType.foo()) && target(t) {
-                // Direct call to non-generic method works
-//                t.bar();
-                // Indirect call to non-generic method works
-//                t.callNormalMethod();
-                // Direct call to generic method works
-//                t.getValue();
-                // Indirect call to generic method produces a NoSuchMethodError
-                t.callGenericMethod();
-        }
-
-//        private void GenericType.callNormalMethod() {
-//                bar();
-//        }
-
-        private void GenericType.callGenericMethod() {
-                getValue();
-        }
-}
\ No newline at end of file
diff --git a/tests/bugs152/pr145391/GenericType2.java b/tests/bugs152/pr145391/GenericType2.java
deleted file mode 100644 (file)
index c5c6ab3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-public class GenericType2<V extends Integer> {
-
-        public GenericType2(V value) {}
-
-        public void foo() {}
-//
-//        public void bar() {}
-
-        protected void getValue(V aV) {
-        }
-
-        public static void main(String[] args) {
-                new GenericType2<Integer>(null).foo();
-        }
-
-}
-
-aspect SomeAspect {
-        before(GenericType2 t): call(* GenericType2.foo()) && target(t) {
-                // Direct call to non-generic method works
-//                t.bar();
-                // Indirect call to non-generic method works
-//                t.callNormalMethod();
-                // Direct call to generic method works
-//                t.getValue();
-                // Indirect call to generic method produces a NoSuchMethodError
-                t.callGenericMethod();
-        }
-
-//        private void GenericType.callNormalMethod() {
-//                bar();
-//        }
-
-        private void GenericType2.callGenericMethod() {
-                getValue(new Integer(45));
-        }
-}
\ No newline at end of file
diff --git a/tests/bugs162/pr145391/B.class b/tests/bugs162/pr145391/B.class
new file mode 100644 (file)
index 0000000..e91f701
Binary files /dev/null and b/tests/bugs162/pr145391/B.class differ
diff --git a/tests/bugs162/pr145391/GenericType.java b/tests/bugs162/pr145391/GenericType.java
new file mode 100644 (file)
index 0000000..897e1b7
--- /dev/null
@@ -0,0 +1,38 @@
+public class GenericType<V extends Integer> {
+
+        public GenericType(V value) {}
+
+        public void foo() {}
+//
+//        public void bar() {}
+
+        protected V getValue() {
+                return null;
+        }
+
+        public static void main(String[] args) {
+                new GenericType<Integer>(null).foo();
+        }
+
+}
+
+aspect SomeAspect {
+        before(GenericType t): call(* GenericType.foo()) && target(t) {
+                // Direct call to non-generic method works
+//                t.bar();
+                // Indirect call to non-generic method works
+//                t.callNormalMethod();
+                // Direct call to generic method works
+//                t.getValue();
+                // Indirect call to generic method produces a NoSuchMethodError
+                t.callGenericMethod();
+        }
+
+//        private void GenericType.callNormalMethod() {
+//                bar();
+//        }
+
+        private void GenericType.callGenericMethod() {
+                getValue();
+        }
+}
\ No newline at end of file
diff --git a/tests/bugs162/pr145391/GenericType2.java b/tests/bugs162/pr145391/GenericType2.java
new file mode 100644 (file)
index 0000000..c99919e
--- /dev/null
@@ -0,0 +1,25 @@
+public class GenericType2<V extends Integer> {
+
+        public GenericType2(V value) {}
+
+        public void foo() {}
+
+        protected void getValue(V aV) {
+        }
+
+        public static void main(String[] args) {
+                new GenericType2<Integer>(null).foo();
+        }
+
+}
+
+aspect SomeAspect {
+        before(GenericType2 t): call(* GenericType2.foo()) && target(t) {
+                // Indirect call to generic method produces a NoSuchMethodError
+                t.callGenericMethod();
+        }
+
+        private void GenericType2.callGenericMethod() {
+                getValue(new Integer(45));
+        }
+}
diff --git a/tests/bugs162/pr145391/x/GenericType2.java b/tests/bugs162/pr145391/x/GenericType2.java
new file mode 100644 (file)
index 0000000..8d5fb56
--- /dev/null
@@ -0,0 +1,25 @@
+interface Bar {}
+
+class B implements Bar {}
+
+public class GenericType2<V extends Bar> {
+
+        public GenericType2(V value) {}
+
+        protected void getValue(V aV) {
+        }
+  public void m() {
+    getValue(new B());
+}
+}
+
+aspect SomeAspect {
+        before(GenericType2 t): call(* GenericType2.foo()) && target(t) {
+                // Indirect call to generic method produces a NoSuchMethodError
+                t.callGenericMethod();
+        }
+
+        private void GenericType2.callGenericMethod() {
+//                getValue(new Integer(45));
+        }
+}
index dc7d2aede4e36b88012cdb0944a4585c5aefb93c..570a51343df31220e7db88db9ff94911cecc8ea9 100644 (file)
@@ -27,8 +27,6 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //  public void testSuperITDExplosion_pr134425() { runTest("super ITDs");}
 //  public void testMisbehavingDeclareAnnotation_pr135865() { runTest("misbehaving declare annotation");}
 //  public void testMisbehavingDeclareAnnotation_pr135865_2() { runTest("misbehaving declare annotation - 2");}
-//  public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");}
-//  public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
 //  public void testClassCastForInvalidAnnotationValue_pr148537() { runTest("classcast annotation value");}
        
        
index 3e7b08082192c8b7cacc0f8548213c39b1153134..ecd73f1066b3e6d242ad43ec0f82c99e570651ae 100644 (file)
      </run>
     </ajc-test>
  
-       <ajc-test dir="bugs152/pr145391" title="itd calling generic method">
-     <compile files="GenericType.java" options="-1.5"/>
-     <run class="GenericType"/>
-    </ajc-test>
     
        <ajc-test dir="bugs152/pr148536" title="NPE for unknown annotation">
      <compile files="Bug.java" options="-1.5">
       <run class="MyClass"/>
     </ajc-test>
 
-       <ajc-test dir="bugs152/pr145391" title="itd calling generic method - 2">
-     <compile files="GenericType2.java" options="-1.5"/>
-     <run class="GenericType2"/>
-    </ajc-test>
-    
        <ajc-test dir="bugs152/pr126355" title="bizarre generic error with itds">
      <compile files="Pair.java" options="-1.5"/>
      <compile files="Test.java" options="-1.5"/>
index 71cadc222c37b1bd875899dfa9206d98f66bae67..3f970fb2fd427a0e14b2ed41a373c0ee57e3faa1 100644 (file)
@@ -19,6 +19,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.2 
+    public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");}
+    public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
        public void testPublicPointcut_pr239539() { runTest("public pointcut"); }
        public void testGenericDecp_pr241047() { runTest("generic decp"); }
        public void testGenericDecp_pr241047_2() { runTest("generic decp - 2"); }
index 5685bc9e560461e2a4690301c4a3f2f419003e48..7699dcc38162618be8836427653f6da70bb82590 100644 (file)
@@ -3,6 +3,17 @@
 <!-- AspectJ v1.6.2 Tests -->
 <suite>
 
+       <ajc-test dir="bugs162/pr145391" title="itd calling generic method">
+     <compile files="GenericType.java" options="-1.5"/>
+     <run class="GenericType"/>
+    </ajc-test>
+
+       <ajc-test dir="bugs162/pr145391" title="itd calling generic method - 2">
+     <compile files="GenericType2.java" options="-1.5">
+       <message kind="error" text="The method getValue(V) in the type GenericType2&lt;V&gt; is not applicable for the arguments"/>
+     </compile>
+    </ajc-test>
+    
     <ajc-test dir="bugs162/pr241047" title="generic decp">
         <compile files="SomeAspect.java SomeBaseClass.java SomeSubClass.java SomeSubClass2.java SomeSubClass3.java SomeInterface.java SomeBaseClass2.java SomeBaseClass3.java" options=" -Xlint:ignore -1.5">
         </compile>