]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 211146 and hasMethod semantics - commented out right now
authoraclement <aclement>
Tue, 26 Feb 2008 16:31:38 +0000 (16:31 +0000)
committeraclement <aclement>
Tue, 26 Feb 2008 16:31:38 +0000 (16:31 +0000)
tests/bugs160/pr211146/DemoUsage.java [new file with mode: 0755]
tests/bugs160/pr211146/StringAspect.aj [new file with mode: 0755]
tests/bugs160/pr211146/StringClass.java [new file with mode: 0755]
tests/bugs160/various/HasMethodSemantics.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
tests/src/org/aspectj/systemtest/ajc160/ajc160.xml

diff --git a/tests/bugs160/pr211146/DemoUsage.java b/tests/bugs160/pr211146/DemoUsage.java
new file mode 100755 (executable)
index 0000000..200ece6
--- /dev/null
@@ -0,0 +1,9 @@
+public class DemoUsage {\r
+       public static void main(String[] args) {\r
+               StringClass sc = new StringClass();\r
+               sc.getStrings().add("AspectJ");\r
+               for(String s : sc.getStrings()) {\r
+                       System.out.println(s);\r
+               }\r
+       }\r
+}
\ No newline at end of file
diff --git a/tests/bugs160/pr211146/StringAspect.aj b/tests/bugs160/pr211146/StringAspect.aj
new file mode 100755 (executable)
index 0000000..85b959d
--- /dev/null
@@ -0,0 +1,7 @@
+import java.util.*;\r
+\r
+public aspect StringAspect {\r
+       public Collection<String> StringClass.getStrings() {\r
+               return new ArrayList<String>();\r
+       }\r
+}\r
diff --git a/tests/bugs160/pr211146/StringClass.java b/tests/bugs160/pr211146/StringClass.java
new file mode 100755 (executable)
index 0000000..8a4e6d3
--- /dev/null
@@ -0,0 +1 @@
+public class StringClass {}
\ No newline at end of file
diff --git a/tests/bugs160/various/HasMethodSemantics.java b/tests/bugs160/various/HasMethodSemantics.java
new file mode 100644 (file)
index 0000000..df553a6
--- /dev/null
@@ -0,0 +1,12 @@
+
+public class HasMethodSemantics {
+       public static void main(String []argv) {
+               System.out.println("Implements Marker? "+(new HasMethodSemantics() instanceof Marker?"yes":"no"));
+       }
+}
+
+interface Marker {}
+
+aspect X {
+       declare parents: HasMethodSemantics && hasmethod(String toString(..)) implements Marker;
+}
\ No newline at end of file
index 34c2369738191739b313f97147e1612a6905a319..a5df41ab540a35339a9c3e34729b9824a186c9ff 100644 (file)
@@ -20,6 +20,7 @@ import junit.framework.Test;
  */
 public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
+//     public void testHasMethodSemantics() { runTest("hasmethod semantics"); }
        public void testBoundsCheckShouldFail_pr219298() { runTest("bounds check failure");}
        public void testBoundsCheckShouldFail_pr219298_2() { runTest("bounds check failure - 2");}
        public void testGenericMethodMatching_pr204505_1() { runTest("generics method matching - 1");}
@@ -33,8 +34,10 @@ public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        public void testDecpRepetition_pr214559_3() { runTest("decp repetition problem - 3");} // across multiple files
        public void testISEAnnotations_pr209831() { runTest("illegal state exception with annotations");}
        public void testISEAnnotations_pr209831_2() { runTest("illegal state exception with annotations - 2");}
-       
-  /////////////////////////////////////////
+//     public void testITDLostGenerics_pr211146() { runTest("itd lost generic signature");}
+//     public void testITDLostGenerics_pr211146_2() { runTest("itd lost generic signature - field");}
+
+       /////////////////////////////////////////
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Ajc160Tests.class);
   }
index 8747270e30a434c9ed07aef0ba73c27795e5aa6c..09da1df8832fc94b6e97c3748452e13f558b3cd6 100644 (file)
@@ -3,6 +3,15 @@
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
 
+   <ajc-test dir="bugs160/various" title="hasmethod semantics">
+     <compile options="-1.5 -XhasMember -Xlint:ignore" files="HasMethodSemantics.java"/>
+     <run class="HasMethodSemantics">
+       <stdout>
+         <line text="Implements Marker? no"/>
+       </stdout>
+     </run>
+   </ajc-test>
+
    <ajc-test dir="bugs160/pr204505" title="generics method matching - 1">
      <compile options="-1.5 -showWeaveInfo" files="Bug.java">
        <message kind="weave" text="execution(void C.save(java.lang.Object))"/>
@@ -73,4 +82,9 @@
      <run class="Test2"/>
    </ajc-test>
    
+   <ajc-test dir="bugs160/pr211146" title="itd lost generic signature">
+     <compile options=" -1.5" files="StringAspect.aj,StringClass.java" outjar="foo.jar"/>
+     <compile options=" -1.5" files="DemoUsage.java" classpath="foo.jar"/>
+   </ajc-test>
+   
 </suite>
\ No newline at end of file