]> source.dussan.org Git - aspectj.git/commitdiff
226567: test and fix - generic return types and overridden methods
authoraclement <aclement>
Thu, 24 Apr 2008 04:07:25 +0000 (04:07 +0000)
committeraclement <aclement>
Thu, 24 Apr 2008 04:07:25 +0000 (04:07 +0000)
tests/bugs161/pr226567/Bar.java [new file with mode: 0644]
tests/bugs161/pr226567/BarAspect.aj [new file with mode: 0644]
tests/bugs161/pr226567/Foo.java [new file with mode: 0644]
tests/bugs161/pr226567/Main.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/AllTests16.java
tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java
tests/src/org/aspectj/systemtest/ajc160/ajc160.xml
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml [new file with mode: 0644]

diff --git a/tests/bugs161/pr226567/Bar.java b/tests/bugs161/pr226567/Bar.java
new file mode 100644 (file)
index 0000000..c4a0316
--- /dev/null
@@ -0,0 +1,9 @@
+package b;
+
+import java.util.Collection;
+
+
+public interface Bar {
+
+   public Collection<Foo> getFoos();  
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr226567/BarAspect.aj b/tests/bugs161/pr226567/BarAspect.aj
new file mode 100644 (file)
index 0000000..1c62a48
--- /dev/null
@@ -0,0 +1,9 @@
+package a;
+
+import b.Bar;
+import b.Foo;
+
+public aspect BarAspect {
+   
+   declare parents : Foo implements Bar;
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr226567/Foo.java b/tests/bugs161/pr226567/Foo.java
new file mode 100644 (file)
index 0000000..db8076a
--- /dev/null
@@ -0,0 +1,11 @@
+package b;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class Foo {
+
+   public Collection<Foo> getFoos() {
+      return new ArrayList<Foo>() {{ add(new Foo()); }};
+   }
+}
\ No newline at end of file
diff --git a/tests/bugs161/pr226567/Main.java b/tests/bugs161/pr226567/Main.java
new file mode 100644 (file)
index 0000000..51eab33
--- /dev/null
@@ -0,0 +1,12 @@
+package c;
+
+import b.Bar;
+import b.Foo;
+
+public class Main {
+
+   public static void main(String [] args) {
+      Foo foo = new Foo();
+      System.out.println(foo instanceof Bar);      
+   }
+}
\ No newline at end of file
index d23413e83837f019ebd00a7253b07739e8ee6e5f..a698fba2841ed520445b8f7593c390921845407a 100644 (file)
@@ -7,6 +7,7 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.aspectj.systemtest.ajc160.AllTestsAspectJ160;
+import org.aspectj.systemtest.ajc161.AllTestsAspectJ161;
 
 public class AllTests16 {
 
@@ -14,6 +15,7 @@ public class AllTests16 {
                TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.6");
                //$JUnit-BEGIN$
                suite.addTest(AllTestsAspectJ160.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+        suite.addTest(AllTestsAspectJ161.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
                suite.addTest(AllTests15.suite());
                //$JUnit-END$
                return suite;
index 7d20871dbd30af75a570d7179d98207751fca345..6c993299ffe75aadff718cc7a5eec81cc72dd119 100644 (file)
@@ -22,6 +22,9 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.0rc1
+   // public void testPipelineCompilationGenericReturnType_pr226567() {
+     //   runTest("pipeline compilation and generic return type");
+    //}
     public void testPipelineCompilationAnonymous_pr225916() {
         runTest("pipeline compilation and anonymous type");
     }
index eb8f28b06d5e1e691aa1227f3c23a666fab30b1e..809d307d049154ce1a226d3abe3121837b59017a 100644 (file)
@@ -3,6 +3,10 @@
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
 
+    <ajc-test dir="bugs160/pr226567" title="pipeline compilation and generic return type">
+        <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="bugs160/pr225916" title="pipeline compilation and anonymous type">
                <compile files="Test.java TestMBean.java TestAspect.java" options="-showWeaveInfo">
diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
new file mode 100644 (file)
index 0000000..d9321b6
--- /dev/null
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors 
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc161;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+       
+       // AspectJ1.6.0rc1
+    public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); }
+
+    public static Test suite() {
+      return XMLBasedAjcTestCase.loadSuite(Ajc161Tests.class);
+    }
+
+    protected File getSpecFile() {
+      return new File("../tests/src/org/aspectj/systemtest/ajc161/ajc161.xml");
+    }
+  
+}
\ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java b/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java
new file mode 100644 (file)
index 0000000..5ce598f
--- /dev/null
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc161;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ161 {
+
+       public static Test suite() {
+               TestSuite suite = new TestSuite("AspectJ 1.6.1 tests");
+               //$JUnit-BEGIN$
+               suite.addTest(Ajc161Tests.suite());
+        //$JUnit-END$
+               return suite;
+       }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml
new file mode 100644 (file)
index 0000000..77b0b60
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<!-- AspectJ v1.6.1 Tests -->
+<suite>
+
+    <ajc-test dir="bugs161/pr226567" title="pipeline compilation and generic return type">
+        <compile files="BarAspect.aj Foo.java Bar.java" options="-1.5"/>
+        <compile files="BarAspect.aj Bar.java Foo.java" options="-1.5"/>
+    </ajc-test>
+
+</suite>
\ No newline at end of file