]> source.dussan.org Git - aspectj.git/commitdiff
tests for pr108370, enum switch in itd method with target type on the inpath
authoracolyer <acolyer>
Wed, 31 Aug 2005 13:32:52 +0000 (13:32 +0000)
committeracolyer <acolyer>
Wed, 31 Aug 2005 13:32:52 +0000 (13:32 +0000)
tests/bugs150/pr108370/EnumTest.aj [new file with mode: 0644]
tests/bugs150/pr108370/et/Q.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/bugs150/pr108370/EnumTest.aj b/tests/bugs150/pr108370/EnumTest.aj
new file mode 100644 (file)
index 0000000..44286f5
--- /dev/null
@@ -0,0 +1,19 @@
+public aspect EnumTest {
+    public static enum Test {
+       A,B,C
+    }
+
+    public void et.Q.foo(Test t) {
+       switch (t) {
+       case B:
+               System.out.println("B!");
+           break;
+       }
+    }
+    
+    public static void main(String[] args) {
+       et.Q q = new et.Q();
+       q.foo(Test.B);
+       q.foo(Test.C);
+    }
+}
\ No newline at end of file
diff --git a/tests/bugs150/pr108370/et/Q.java b/tests/bugs150/pr108370/et/Q.java
new file mode 100644 (file)
index 0000000..6c07015
--- /dev/null
@@ -0,0 +1,2 @@
+package et;
+public class Q {}
\ No newline at end of file
index afe055400371f1ff46d20c22432754185e8c0444..94823ac7b6bbc745e4de1ce947c6121b65ed7ee5 100644 (file)
@@ -314,6 +314,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
          runTest("type variable with type variable bound");
   }
   
+  public void testEnumSwitchInITD() {
+         runTest("switch on enum inside ITD method");
+  }
+  
   // helper methods.....
   
   public SyntheticRepository createRepos(File cpentry) {
index 201b95688cac98de1d1d0d7088abdd88889e0768..2519f79330c29529f6745049731533831d45ee13 100644 (file)
         <compile files="pr108054.aj" options="-1.5"/>
         <compile files="ISequence.java,ICounter.java,ASequence.java" options="-1.5"/>
     </ajc-test>
-        
+
+    <ajc-test dir="bugs150/pr108370" pr="108370" title="switch on enum inside ITD method">
+        <compile files="et/Q.java" options="-1.5"/>
+        <compile files="EnumTest.aj" options="-1.5 -inpath et"/>
+        <run class="EnumTest">
+            <stdout>
+                <line text="B!"/>
+            </stdout>
+        </run>
+    </ajc-test>
+                
     <!-- ============================================================================ -->
     <!-- ============================================================================ -->