]> source.dussan.org Git - aspectj.git/commitdiff
48080: inserts in messages
authoraclement <aclement>
Sat, 13 Mar 2010 01:02:47 +0000 (01:02 +0000)
committeraclement <aclement>
Sat, 13 Mar 2010 01:02:47 +0000 (01:02 +0000)
tests/bugs169/pr48080/A.class [new file with mode: 0644]
tests/bugs169/pr48080/A.java [new file with mode: 0644]
tests/bugs169/pr48080/Warnings.java [new file with mode: 0644]
tests/bugs169/pr48080/X.class [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java
tests/src/org/aspectj/systemtest/ajc169/ajc169.xml

diff --git a/tests/bugs169/pr48080/A.class b/tests/bugs169/pr48080/A.class
new file mode 100644 (file)
index 0000000..1c77710
Binary files /dev/null and b/tests/bugs169/pr48080/A.class differ
diff --git a/tests/bugs169/pr48080/A.java b/tests/bugs169/pr48080/A.java
new file mode 100644 (file)
index 0000000..c8576ca
--- /dev/null
@@ -0,0 +1,8 @@
+public class A {
+  public void m() {
+  }
+}
+
+aspect X {
+  declare warning: execution(* A.m(..)): "method found";
+}
diff --git a/tests/bugs169/pr48080/Warnings.java b/tests/bugs169/pr48080/Warnings.java
new file mode 100644 (file)
index 0000000..805bc41
--- /dev/null
@@ -0,0 +1,26 @@
+package p;
+
+aspect Checker {
+  declare warning: execution(* A.m(..)): "joinpoint location is {joinpoint.sourcelocation.sourcefile}:{joinpoint.sourcelocation.line}";
+  declare warning: execution(* A.m(..)): "joinpoint is {joinpoint}";
+  declare warning: execution(* A.m(..)): "joinpoint kind is {joinpoint.kind}";
+  declare warning: execution(* A.m(..)): "joinpoint kind is '{joinpoint.kind}'";
+  declare warning: execution(* A.m(..)): "joinpoint line is '{joinpoint.sourcelocation.line}'";
+  declare warning: execution(* A.m(..)): "joinpoint signature is {joinpoint.signature}";
+  declare warning: get(int *) && within(A): "joinpoint signature is {joinpoint.signature}";
+  declare warning: execution(* A.m(..)): "joinpoint declaring type is {joinpoint.signature.declaringType}";
+  declare warning: execution(* A.m(..)): "advice sourcelocation is {advice.sourcelocation.sourcefile}:{advice.sourcelocation.line}";
+  declare warning: get(int *): "aspect is {advice.aspecttype}";
+  declare warning: get(int *): "signature name for field is {joinpoint.signature.name}";
+  declare warning: execution(* A.m(..)): "signature name for method is {joinpoint.signature.name}";
+  declare warning: execution(* A.m(..)): "\\{}wibble";
+  declare warning: execution(* A.m(..)): "{}foobar"; 
+  declare warning: execution(* A.m(..)): "test {advice.sourcelocation.line}\\{}{joinpoint.sourcelocation.line}";
+}
+
+class A {
+  int i;
+  public void m() {
+    System.out.println(i);
+  } 
+}
diff --git a/tests/bugs169/pr48080/X.class b/tests/bugs169/pr48080/X.class
new file mode 100644 (file)
index 0000000..1f95cc9
Binary files /dev/null and b/tests/bugs169/pr48080/X.class differ
index 54872e40df5fe0d5a9c42c988efee0e30c13f7dd..2d04b660ae40c702d62a0371a7fe59ed8c00dec1 100644 (file)
@@ -18,6 +18,34 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc169Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       /*public void testAmbiguousMethod() {
+               runTest("ambiguous method");
+       }*/
+
+       public void testChecker() {
+               runTest("inserts in messages");
+       }
+/*
+       public void testVerifyError() {
+               runTest("verifyerror on atAj");
+       }
+
+       public void testDeclareTypeWarning1() {
+               runTest("declare type warning - 1");
+       }
+
+       public void testDeclareTypeWarning2() {
+               runTest("declare type warning - 2");
+       }
+
+       public void testDeclareTypeWarning3() {
+               runTest("declare type warning - 3");
+       }
+
+       public void testDeclareTypeError1() {
+               runTest("declare type error - 1");
+       }*/
+
        public void testPr298388() {
                runTest("declare mixin and generics");
        }
index 9f2408c2a0a3685ddc0918e1fe80e571cb66b3b4..c3e79969e7eed9b43c7aad419b779c6c142e48c0 100644 (file)
@@ -2,6 +2,38 @@
 
 <suite>
    
+   <ajc-test dir="bugs169/pr48080" title="inserts in messages">
+     <compile files="Warnings.java" options="-1.5">
+       <message kind="warning" text="UNKNOWN_KEY{}foobar"/>
+       <message kind="warning" text="{}wibble"/>
+       <message kind="warning" text="signature name for method is m"/>
+       <message kind="warning" text="joinpoint declaring type is p.A"/>
+       <message kind="warning" text="joinpoint signature is void p.A.m()"/>
+       <message kind="warning" text="joinpoint line is '23'"/>
+       <message kind="warning" text="joinpoint kind is method-execution"/>
+       <message kind="warning" text="joinpoint kind is 'method-execution'"/>
+       <message kind="warning" text="joinpoint is method-execution(void p.A.m())"/>
+       <message kind="warning" text="joinpoint location is"/>
+       <message kind="warning" text="signature name for field is i"/>
+       <message kind="warning" text="joinpoint signature is int p.A.i"/>
+       <message kind="warning" text="aspect is p.Checker"/>
+       <message kind="warning" text="advice sourcelocation is"/>
+       <message kind="warning" text="test 18{}23"/>
+     </compile>
+  </ajc-test>
+  
+   <ajc-test dir="bugs169/pr299062" title="verifyerror on atAj">
+     <compile files="Test.java Work.java SmartAspect.java Idempotent.java" options="-1.5"/>
+     <run class="Test">
+     </run>
+  </ajc-test>
+  
+   <ajc-test dir="bugs169/pr298665" title="ambiguous method">
+     <compile files="Main.java" options="-1.5"/>
+     <run class="Main">
+     </run>
+  </ajc-test>
+  
    <ajc-test dir="bugs169/pr298388" title="declare mixin and generics">
      <compile files="PR298388.java" options="-1.5"/>
      <run class="PR298388">
      </run>
   </ajc-test>
   
+  <!-- declare type warning -->
+  
+  <ajc-test dir="bugs169/pr291206" title="declare type warning - 1">
+     <compile files="One.java" options="-1.5">
+       <message kind="warning" line="8" text="Nothing should be"/>
+     </compile>
+  </ajc-test>
+  
+  <ajc-test dir="bugs169/pr291206" title="declare type warning - 2">
+     <compile files="Two.java" options="-1.5 -XhasMember">
+       <message kind="warning" line="7" text="Missing foo()"/>
+       <message kind="warning" line="13" text="Missing foo()"/>
+     </compile>
+  </ajc-test>
+  
+  <!-- testing build of model with one of these in -->
+  <ajc-test dir="bugs169/pr291206" title="declare type warning - 3">
+     <compile files="Two.java" options="-1.5 -XhasMember -emacssym">
+       <message kind="warning" line="7" text="Missing foo()"/>
+       <message kind="warning" line="13" text="Missing foo()"/>
+     </compile>
+  </ajc-test>
+  
+  <ajc-test dir="bugs169/pr291206" title="declare type error - 1">
+     <compile files="Three.java" options="-1.5 -XhasMember">
+       <message kind="error" line="7" text="Missing foo()"/>
+       <message kind="error" line="13" text="Missing foo()"/>
+     </compile>
+  </ajc-test>
+  
 </suite>
\ No newline at end of file