]> source.dussan.org Git - aspectj.git/commitdiff
233838: testcode: itd and declare precedence
authoraclement <aclement>
Tue, 27 May 2008 16:44:14 +0000 (16:44 +0000)
committeraclement <aclement>
Tue, 27 May 2008 16:44:14 +0000 (16:44 +0000)
tests/bugs161/pr233838/Z.java [new file with mode: 0644]
tests/bugs161/pr233838/Z2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
tests/src/org/aspectj/systemtest/ajc161/ajc161.xml

diff --git a/tests/bugs161/pr233838/Z.java b/tests/bugs161/pr233838/Z.java
new file mode 100644 (file)
index 0000000..5a3e8bc
--- /dev/null
@@ -0,0 +1,17 @@
+interface X {
+   static aspect IMPL {
+      public void X.test() { System.out.println("X.test()"); }
+   }
+}
+
+interface Y {
+   static aspect IMPL {
+      declare precedence : X.IMPL, Y.IMPL;
+
+      public void Y.test() { System.out.println("Y.test()"); }
+   }
+}
+
+public class Z implements X, Y {
+   public static void main(String[] args) throws Exception { new Z().test(); }
+}
diff --git a/tests/bugs161/pr233838/Z2.java b/tests/bugs161/pr233838/Z2.java
new file mode 100644 (file)
index 0000000..9123a34
--- /dev/null
@@ -0,0 +1,17 @@
+interface X {
+   static aspect IMPL {
+      public void X.test() { System.out.println("X.test()"); }
+   }
+}
+
+interface Y {
+   static aspect IMPL {
+      declare precedence : Y.IMPL, X.IMPL;
+
+      public void Y.test() { System.out.println("Y.test()"); }
+   }
+}
+
+public class Z2 implements X, Y {
+   public static void main(String[] args) throws Exception { new Z2().test(); }
+}
index 6fe3c414f7db8dbed070ab2a9a8ba53b175718f6..e367736243ec79b460cb790aad2ff52af6f58de7 100644 (file)
@@ -19,6 +19,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.1
+       public void testITDPrecedence_pr233838_1() { runTest("itd precedence - 1"); }
+       public void testITDPrecedence_pr233838_2() { runTest("itd precedence - 2"); }
        public void testGetFieldGenerics_pr227401() { runTest("getfield problem with generics");}
        public void testGenericAbstractAspects_pr231478() { runTest("generic abstract aspects"); }
     public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); }
index de172f61f30391d5b178382f2e7d8d70782a5e6c..d75609647d4d9558cf9d1825d741a010e334c507 100644 (file)
@@ -3,6 +3,25 @@
 <!-- AspectJ v1.6.1 Tests -->
 <suite>
 
+    <ajc-test dir="bugs161/pr233838" title="itd precedence - 1">
+        <compile files="Z.java" options="-1.5"/>
+        <run class="Z">
+          <stdout>
+            <line text="X.test()"/>
+          </stdout>
+        </run>
+    </ajc-test>
+
+    <ajc-test dir="bugs161/pr233838" title="itd precedence - 2">
+        <compile files="Z2.java" options="-1.5"/>
+        <run class="Z2">
+          <stdout>
+            <line text="Y.test()"/>
+          </stdout>
+        </run>
+    </ajc-test>
+    
+
     <ajc-test dir="bugs161/pr227401" title="getfield problem with generics">
         <compile files="Instrumentation.java Fails.java" options="-1.5"/>
         <run class="Fails">