]> source.dussan.org Git - aspectj.git/commitdiff
harness tests for extra source locations and details
authorwisberg <wisberg>
Fri, 9 Jan 2004 05:36:45 +0000 (05:36 +0000)
committerwisberg <wisberg>
Fri, 9 Jan 2004 05:36:45 +0000 (05:36 +0000)
tests/ajcHarnessTests.xml
tests/harness/CompoundMessage.java [new file with mode: 0644]

index 0170b712455a169aef712fcbdc86e3847293c0ed..88385aa80bbdc0696784f2f3e85657f090fb93a2 100644 (file)
         <compile files="input-path-classes" sourceroots="aspectsrc"/>
         <run class="Main"/>
     </ajc-test>
+    
+    <ajc-test dir="harness"
+      title="pass 2 compound warning">
+        <compile files="CompoundMessage.java">
+            <message kind="warning" line="6">
+               <source line="14" file="CompoundMessage.java"/>
+            </message>
+            <message kind="warning" line="6">
+               <source line="12" file="CompoundMessage.java"/>
+            </message>
+        </compile>
+    </ajc-test>
+
+    <ajc-test dir="harness"
+      title="fail 2 error, but expecting more details">
+        <compile files="ErrorTest.java">
+            <message kind="error" line="5" details="expecting more"/>
+            <message kind="error" line="6" details="details"/>
+        </compile>
+    </ajc-test>
 
 </suite>
 
diff --git a/tests/harness/CompoundMessage.java b/tests/harness/CompoundMessage.java
new file mode 100644 (file)
index 0000000..88d2584
--- /dev/null
@@ -0,0 +1,16 @@
+
+class A { void run() {} }
+class B extends A {}
+aspect C {
+    before() : runB() { } 
+    pointcut runB(): call(void B.run());  // CW 6 XLint, for each shadow (12, 14) 
+
+}
+public class CompoundMessage {
+    public static void main(String[] args) {
+        // ok with -1.4; otherwise, becomes A.run in bytecode
+        new B().run();        // CW 12 DW
+        // never works - compile-time type of reference is A, not B
+        new B().run();        // CW 12 DW
+    }
+}