]> source.dussan.org Git - aspectj.git/commitdiff
Testcase for Bug 149322 "Change Xlint cantFindType default to warning"
authormwebster <mwebster>
Fri, 7 Jul 2006 13:42:43 +0000 (13:42 +0000)
committermwebster <mwebster>
Fri, 7 Jul 2006 13:42:43 +0000 (13:42 +0000)
tests/bugs153/pr149322/Aspect.aj [new file with mode: 0644]
tests/bugs153/pr149322/Interface.java [new file with mode: 0644]
tests/bugs153/pr149322/Missing.java [new file with mode: 0644]
tests/bugs153/pr149322/TestFail.java [new file with mode: 0644]
tests/bugs153/pr149322/TestPass.java [new file with mode: 0644]
tests/bugs153/pr149322/aop.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

diff --git a/tests/bugs153/pr149322/Aspect.aj b/tests/bugs153/pr149322/Aspect.aj
new file mode 100644 (file)
index 0000000..80b75e9
--- /dev/null
@@ -0,0 +1,7 @@
+
+public aspect Aspect {
+
+       before () : call(public * method(..)) && target(Interface) {
+               System.out.println("Aspect.before()");
+       }
+}
diff --git a/tests/bugs153/pr149322/Interface.java b/tests/bugs153/pr149322/Interface.java
new file mode 100644 (file)
index 0000000..8b6b247
--- /dev/null
@@ -0,0 +1,5 @@
+
+public interface Interface {
+
+       public void method ();
+}
diff --git a/tests/bugs153/pr149322/Missing.java b/tests/bugs153/pr149322/Missing.java
new file mode 100644 (file)
index 0000000..51d8dc4
--- /dev/null
@@ -0,0 +1,8 @@
+
+public class Missing implements Interface {
+
+       public void method () {
+               System.out.println("Missing.method()");
+       }
+       
+}
diff --git a/tests/bugs153/pr149322/TestFail.java b/tests/bugs153/pr149322/TestFail.java
new file mode 100644 (file)
index 0000000..549a48b
--- /dev/null
@@ -0,0 +1,14 @@
+public class TestFail {
+
+       public void invoke () {
+               Interface i = new Missing();
+               i.method();
+               Missing cf = new Missing();
+               cf.method();
+       }
+       
+       public static void main(String[] args) {
+               new TestFail().invoke();
+       }
+
+}
diff --git a/tests/bugs153/pr149322/TestPass.java b/tests/bugs153/pr149322/TestPass.java
new file mode 100644 (file)
index 0000000..c743033
--- /dev/null
@@ -0,0 +1,13 @@
+
+public class TestPass {
+
+       public void invoke () {
+               Interface i = new CantFind();
+               i.method();
+       }
+       
+       public static void main(String[] args) {
+               new TestFail();
+       }
+
+}
diff --git a/tests/bugs153/pr149322/aop.xml b/tests/bugs153/pr149322/aop.xml
new file mode 100644 (file)
index 0000000..ec0fcfb
--- /dev/null
@@ -0,0 +1,6 @@
+<aspectj>
+       <aspects>
+               <aspect name="Aspect"/>
+       </aspects>
+       <weaver options="-verbose -showWeaveInfo"/>
+</aspectj>
\ No newline at end of file
index 6c3b5b0b438f53f2851e398b36fd28b931059b1a..6c844d7496884f80a5324c5d1b8b2c9213fa3261 100644 (file)
@@ -36,6 +36,10 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // public void testVisibilityProblem_pr149071()                 { runTest("visibility problem");}
   // public void testAdviceNotWovenAspectPath_pr147841()          { runTest("advice not woven on aspectpath");}
   public void testGenericSignatures_pr148409()                 { runTest("generic signature problem"); }
+
+  public void testCantFindType_pr149322_1() {
+         runTest("can't find type on interface call");
+  }
   
   /////////////////////////////////////////
   public static Test suite() {
index 30c4a1a8aa2176adb26d428abee6dd59ccd07d67..fc8b354701dea405235cfac2115c58c692be3d67 100644 (file)
       </run>
     </ajc-test>    
     
+       <ajc-test dir="bugs153/pr149322" title="can't find type on interface call">
+               <compile files="Interface.java"/>
+        <compile
+                       files="Missing.java"
+               outjar="missing.jar"
+        />
+       <compile files="TestFail.java" classpath="missing.jar"/>
+<!--
+       <compile files="Aspect.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
+               <message kind="weave" text="void Interface.method()"/>
+               <message kind="weave" text="void Missing.method()"/>
+               </compile>              
+       <compile files="Aspect.aj" options="-showWeaveInfo -inpath .">
+               <message kind="weave" text="void Interface.method()"/>
+               <message kind="weave" text="void Missing.method()"/>
+               </compile>              
+-->            
+       <compile files="Aspect.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
+               <message kind="weave" text="void Interface.method()"/>
+               <message kind="warning" text="Missing"/>
+               </compile>              
+<!--           
+       <run class="TestFail" ltw="aop.xml"/>
+-->            
+    </ajc-test>    
+    
 </suite>
\ No newline at end of file