]> source.dussan.org Git - aspectj.git/commitdiff
Testcases for Bug 149322 "Change Xlint cantFindType default to warning"
authormwebster <mwebster>
Mon, 10 Jul 2006 15:31:16 +0000 (15:31 +0000)
committermwebster <mwebster>
Mon, 10 Jul 2006 15:31:16 +0000 (15:31 +0000)
12 files changed:
tests/bugs153/pr149322/Aspect.aj [deleted file]
tests/bugs153/pr149322/Aspect1.aj [new file with mode: 0644]
tests/bugs153/pr149322/Aspect2.aj [new file with mode: 0644]
tests/bugs153/pr149322/Aspect3.aj [new file with mode: 0644]
tests/bugs153/pr149322/Interface.java
tests/bugs153/pr149322/Missing.java
tests/bugs153/pr149322/TestFail.java [deleted file]
tests/bugs153/pr149322/TestPass.java [deleted file]
tests/bugs153/pr149322/TestWithMissing.java [new file with mode: 0644]
tests/bugs153/pr149322/aop.xml [deleted file]
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
deleted file mode 100644 (file)
index 80b75e9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-public aspect Aspect {
-
-       before () : call(public * method(..)) && target(Interface) {
-               System.out.println("Aspect.before()");
-       }
-}
diff --git a/tests/bugs153/pr149322/Aspect1.aj b/tests/bugs153/pr149322/Aspect1.aj
new file mode 100644 (file)
index 0000000..13788d2
--- /dev/null
@@ -0,0 +1,6 @@
+public aspect Aspect1 {
+
+       before () : call(public * interfaceMethod(..)) && target(Interface) {
+               System.out.println("Aspect1.before() " + thisJoinPoint.getSignature().getName());
+       }
+}
diff --git a/tests/bugs153/pr149322/Aspect2.aj b/tests/bugs153/pr149322/Aspect2.aj
new file mode 100644 (file)
index 0000000..48a482c
--- /dev/null
@@ -0,0 +1,6 @@
+public aspect Aspect2 {
+
+       before () : call(public * Interface.interfaceMethod(..)) {
+               System.out.println("Aspect2.before() " + thisJoinPoint.getSignature().getName());
+       }
+}
diff --git a/tests/bugs153/pr149322/Aspect3.aj b/tests/bugs153/pr149322/Aspect3.aj
new file mode 100644 (file)
index 0000000..c7a2383
--- /dev/null
@@ -0,0 +1,6 @@
+public aspect Aspect3 {
+
+       before () : call(public * Interface.*(..)) {
+               System.out.println("Aspect3.before() " + thisJoinPoint.getSignature().getName());
+       }
+}
index 8b6b247f0ff96e4c7160cacfb4f538c2ca495e94..c2fb7773ad85fbae27458871c8d74ab2bc8d5a14 100644 (file)
@@ -1,5 +1,5 @@
 
 public interface Interface {
 
-       public void method ();
+       public void interfaceMethod ();
 }
index 51d8dc42e54bd0853627fc43dbb9a87e259baacc..f70afe09d53541fc94798e7597429bed7e9be409 100644 (file)
@@ -1,8 +1,12 @@
 
 public class Missing implements Interface {
+       
+       public void interfaceMethod () {
+               System.out.println("Missing.interfaceMethod()");
+       }
 
-       public void method () {
-               System.out.println("Missing.method()");
+       public void missingMethod () {
+               System.out.println("Missing.missingMethod()");
        }
        
 }
diff --git a/tests/bugs153/pr149322/TestFail.java b/tests/bugs153/pr149322/TestFail.java
deleted file mode 100644 (file)
index 549a48b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-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
deleted file mode 100644 (file)
index c743033..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-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/TestWithMissing.java b/tests/bugs153/pr149322/TestWithMissing.java
new file mode 100644 (file)
index 0000000..4f2e9d6
--- /dev/null
@@ -0,0 +1,15 @@
+public class TestWithMissing {
+
+       public void invoke () {
+               Interface i = new Missing();
+               i.interfaceMethod();
+               Missing m = new Missing();
+               m.interfaceMethod();
+               m.missingMethod();
+       }
+       
+       public static void main(String[] args) {
+               new TestWithMissing().invoke();
+       }
+
+}
diff --git a/tests/bugs153/pr149322/aop.xml b/tests/bugs153/pr149322/aop.xml
deleted file mode 100644 (file)
index ec0fcfb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<aspectj>
-       <aspects>
-               <aspect name="Aspect"/>
-       </aspects>
-       <weaver options="-verbose -showWeaveInfo"/>
-</aspectj>
\ No newline at end of file
index ead8d9d7748e7adfc7dd83e89a1be742c68c7982..1fced4c80f6423b1957a429ec3a9869b1b3aaf55 100644 (file)
@@ -38,7 +38,9 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // public void testAdviceNotWovenAspectPath_pr147841()          { runTest("advice not woven on aspectpath");}
   public void testGenericSignatures_pr148409()                 { runTest("generic signature problem"); }
 //  public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");}
-  public void testCantFindType_pr149322_1() {runTest("can't find type on interface call");}
+  public void testCantFindType_pr149322_01() {runTest("can't find type on interface call 1");}
+  public void testCantFindType_pr149322_02() {runTest("can't find type on interface call 2");}
+  public void testCantFindType_pr149322_03() {runTest("can't find type on interface call 3");}
 
   /////////////////////////////////////////
   public static Test suite() {
index 42657d656f83e35b51b873c1798a22f9de334f62..0181bd5973641e015cb8372321459998e36678aa 100644 (file)
      <compile files="Foo.java" options="-1.5"/>
     </ajc-test> 
     
-       <ajc-test dir="bugs153/pr149322" title="can't find type on interface call">
+       <ajc-test dir="bugs153/pr149322" title="can't find type on interface call 1">
                <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 files="TestWithMissing.java" classpath="missing.jar"/>
+       <compile files="Aspect1.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
+               <message kind="weave" text="void Interface.interfaceMethod()"/>
+               <message kind="weave" text="void Missing.interfaceMethod()"/>
                </compile>              
-       <compile files="Aspect.aj" options="-showWeaveInfo -inpath .">
-               <message kind="weave" text="void Interface.method()"/>
-               <message kind="weave" text="void Missing.method()"/>
+       <compile files="Aspect1.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
+               <message kind="weave" text="void Interface.interfaceMethod()"/>
+               <message kind="warning" text="can't determine superclass of missing type Missing"/>
                </compile>              
--->            
-       <compile files="Aspect.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
-               <message kind="weave" text="void Interface.method()"/>
-               <message kind="warning" text="Missing"/>
+       <run class="TestWithMissing">
+                       <stdout>
+                       <line text="Aspect1.before() interfaceMethod"/>
+                       <line text="Missing.interfaceMethod()"/>
+<!--                   
+                       <line text="Aspect1.before() interfaceMethod"/>
+-->
+                       <line text="Missing.interfaceMethod()"/>
+                       <line text="Missing.missingMethod()"/>
+               </stdout>
+       </run>
+    </ajc-test>    
+       <ajc-test dir="bugs153/pr149322" title="can't find type on interface call 2">
+               <compile files="Interface.java"/>
+        <compile
+                       files="Missing.java"
+               outjar="missing.jar"
+        />
+       <compile files="TestWithMissing.java" classpath="missing.jar"/>
+       <compile files="Aspect2.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
+               <message kind="weave" text="void Interface.interfaceMethod()"/>
+               <message kind="weave" text="void Missing.interfaceMethod()"/>
+               </compile>              
+       <compile files="Aspect2.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
+               <message kind="weave" text="void Interface.interfaceMethod()"/>
+               <message kind="warning" text="can't determine whether missing type Missing is an instance of Interface"/>
+               <message kind="warning" text="can't determine superclass of missing type Missing"/>
+               </compile>              
+       <run class="TestWithMissing">
+                       <stdout>
+                       <line text="Aspect2.before() interfaceMethod"/>
+                       <line text="Missing.interfaceMethod()"/>
+<!--                   
+                       <line text="Aspect2.before() interfaceMethod"/>
+-->
+                       <line text="Missing.interfaceMethod()"/>
+                       <line text="Missing.missingMethod()"/>
+               </stdout>
+       </run>
+    </ajc-test>    
+       <ajc-test dir="bugs153/pr149322" title="can't find type on interface call 3">
+               <compile files="Interface.java"/>
+        <compile
+                       files="Missing.java"
+               outjar="missing.jar"
+        />
+       <compile files="TestWithMissing.java" classpath="missing.jar"/>
+       <compile files="Aspect3.aj" options="-showWeaveInfo -inpath ." classpath="missing.jar">
+               <message kind="weave" text="void Interface.interfaceMethod()"/>
+               <message kind="weave" text="void Missing.interfaceMethod()"/>
+               </compile>              
+       <compile files="Aspect3.aj" options="-Xlint:warning -showWeaveInfo -inpath .">
+               <message kind="weave" text="void Interface.interfaceMethod()"/>
+               <message kind="warning" text="can't determine whether missing type Missing is an instance of Interface"/>
+               <message kind="warning" text="can't determine superclass of missing type Missing"/>
                </compile>              
-<!--           
-       <run class="TestFail" ltw="aop.xml"/>
--->            
+       <run class="TestWithMissing">
+                       <stdout>
+                       <line text="Aspect3.before() interfaceMethod"/>
+                       <line text="Missing.interfaceMethod()"/>
+<!--                   
+                       <line text="Aspect3.before() interfaceMethod"/>
+-->
+                       <line text="Missing.interfaceMethod()"/>
+                       <line text="Missing.missingMethod()"/>
+               </stdout>
+       </run>
     </ajc-test>    
     
 </suite>
\ No newline at end of file