]> source.dussan.org Git - aspectj.git/commitdiff
214559: tests and fix: cope with varying orderings for interdependant declare parents...
authoraclement <aclement>
Wed, 20 Feb 2008 21:07:44 +0000 (21:07 +0000)
committeraclement <aclement>
Wed, 20 Feb 2008 21:07:44 +0000 (21:07 +0000)
tests/bugs160/pr214559/DeclareParentsPrecedenceTest.java [new file with mode: 0644]
tests/bugs160/pr214559/Interface1.java [new file with mode: 0644]
tests/bugs160/pr214559/Interface1TestClass.java [new file with mode: 0644]
tests/bugs160/pr214559/TestAspect.java [new file with mode: 0644]
tests/bugs160/pr214559/TestClass.java [new file with mode: 0644]
tests/bugs160/pr214559/X.java [new file with mode: 0644]
tests/bugs160/pr214559/Y.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/pr214559/DeclareParentsPrecedenceTest.java b/tests/bugs160/pr214559/DeclareParentsPrecedenceTest.java
new file mode 100644 (file)
index 0000000..fdf77f0
--- /dev/null
@@ -0,0 +1,8 @@
+
+public class DeclareParentsPrecedenceTest {
+  public static void main(String[]argv) {
+    TestClass t = new TestClass();
+    if (!(t instanceof Interface1)) throw new RuntimeException("t not instanceof Interface1");
+    if (!(t instanceof Interface1TestClass)) throw new RuntimeException("t not instanceof Interface1TestClass");
+  }
+}
diff --git a/tests/bugs160/pr214559/Interface1.java b/tests/bugs160/pr214559/Interface1.java
new file mode 100644 (file)
index 0000000..5ad8405
--- /dev/null
@@ -0,0 +1 @@
+interface Interface1 {}
diff --git a/tests/bugs160/pr214559/Interface1TestClass.java b/tests/bugs160/pr214559/Interface1TestClass.java
new file mode 100644 (file)
index 0000000..ae149a4
--- /dev/null
@@ -0,0 +1 @@
+interface Interface1TestClass {}
diff --git a/tests/bugs160/pr214559/TestAspect.java b/tests/bugs160/pr214559/TestAspect.java
new file mode 100644 (file)
index 0000000..6535601
--- /dev/null
@@ -0,0 +1,7 @@
+aspect TestAspect  {
+        declare parents: 
+                TestClass implements Interface1;
+
+        declare parents: 
+                TestClass && Interface1+ implements Interface1TestClass;
+}
diff --git a/tests/bugs160/pr214559/TestClass.java b/tests/bugs160/pr214559/TestClass.java
new file mode 100644 (file)
index 0000000..90caf07
--- /dev/null
@@ -0,0 +1 @@
+class TestClass {}
diff --git a/tests/bugs160/pr214559/X.java b/tests/bugs160/pr214559/X.java
new file mode 100644 (file)
index 0000000..7f2861b
--- /dev/null
@@ -0,0 +1,23 @@
+
+package test;
+
+public class X {
+  public static void main(String[]argv) {
+    TestClass t = new TestClass();
+    if (!(t instanceof Interface1)) throw new RuntimeException("t not instanceof Interface1");
+    if (!(t instanceof Interface1TestClass)) throw new RuntimeException("t not instanceof Interface1TestClass");
+  }
+}
+
+interface Interface1 {}
+
+interface Interface1TestClass {}
+
+aspect TestAspect  {
+        declare parents: 
+                TestClass implements Interface1;
+
+        declare parents: 
+                TestClass && Interface1+ implements Interface1TestClass;
+}
+class TestClass {}
diff --git a/tests/bugs160/pr214559/Y.java b/tests/bugs160/pr214559/Y.java
new file mode 100644 (file)
index 0000000..c1efa1e
--- /dev/null
@@ -0,0 +1,20 @@
+
+public class Y {
+  public static void main(String[]argv) {
+    TestClass t = new TestClass();
+    if (!(t instanceof Interface1)) throw new RuntimeException("t not instanceof Interface1");
+    if (!(t instanceof Interface1TestClass)) throw new RuntimeException("t not instanceof Interface1TestClass");
+  }
+}
+
+interface Interface1 {}
+
+interface Interface1TestClass {}
+
+aspect TestAspect  {
+        declare parents: TestClass implements Interface1;
+
+        declare parents: TestClass && Interface1+ implements Interface1TestClass;
+}
+
+class TestClass {}
index 3c49de7fcb9fd6388ff1495417a660f2ed8757ab..b35347709e3b81e4bf05e2619b6442c8604c6da4 100644 (file)
@@ -28,7 +28,10 @@ public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        public void testGenericsSuperITD_pr206911() { runTest("generics super itd"); }
        public void testGenericsSuperITD_pr206911_2() { runTest("generics super itd - 2"); }
        public void testSerializationAnnotationStyle_pr216311() { runTest("serialization and annotation style");}
-
+       public void testDecpRepetition_pr214559() { runTest("decp repetition problem");} // all code in one file
+       public void testDecpRepetition_pr214559_2() { runTest("decp repetition problem - 2");} // all code in one file, default package
+       public void testDecpRepetition_pr214559_3() { runTest("decp repetition problem - 3");} // across multiple files
+       
   /////////////////////////////////////////
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Ajc160Tests.class);
index 99cb1b17d86192e97ed095587aa54a90f550ad14..fdf8f0dd95a12f554b8c8a73f685af64968137e0 100644 (file)
      <compile options="-1.5" files="PersistabilityTest.java,IPersistable.java,Persistability.java"/>
      <run class="PersistabilityTest"/>
    </ajc-test>
+
+   <ajc-test dir="bugs160/pr214559" title="decp repetition problem">
+     <compile files="X.java"/>
+     <run class="test.X"/>
+   </ajc-test>
+   
+   <ajc-test dir="bugs160/pr214559" title="decp repetition problem - 2">
+     <compile files="Y.java"/>
+     <run class="Y"/>
+   </ajc-test>
+
+   <ajc-test dir="bugs160/pr214559" title="decp repetition problem - 3">
+     <compile files="TestClass.java Interface1.java Interface1TestClass.java DeclareParentsPrecedenceTest.java TestAspect.java"/>
+     <run class="DeclareParentsPrecedenceTest"/>
+   </ajc-test>
    
 </suite>
\ No newline at end of file