]> source.dussan.org Git - aspectj.git/commitdiff
more overweaving tests and fixes
authoraclement <aclement>
Wed, 12 May 2010 20:19:39 +0000 (20:19 +0000)
committeraclement <aclement>
Wed, 12 May 2010 20:19:39 +0000 (20:19 +0000)
tests/features167/overweaving/cflow/A.aj
tests/features167/overweaving/cflow/X.aj
tests/features167/overweaving/messy/A.aj
tests/features167/overweaving/messy/X.aj
tests/features167/overweaving/messy2/A.aj [new file with mode: 0644]
tests/features167/overweaving/messy2/B.aj [new file with mode: 0644]
tests/features167/overweaving/messy2/Class1.java [new file with mode: 0644]
tests/features167/overweaving/messy2/Class2.java [new file with mode: 0644]
tests/features167/overweaving/messy2/aop.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
tests/src/org/aspectj/systemtest/ajc167/overweaving.xml

index 961f489c1d7e42b4ed279b5d68677230a00bcaae..b7e3fcb918f4530076ebd45d7e1bfb38c026d89d 100644 (file)
@@ -10,7 +10,7 @@ aspect A {
   public void C.m() {}
 
   before(): execution(* C.main(..)) {
-    System.out.println("AspectA>>"+thisJoinPointStaticPart);
+    System.out.println("A:"+thisJoinPointStaticPart);
   }
 
 }
index e8fe7dfb0eaa6d9cd666111545d208708395cf20..9c576aeed6c64dd1f4dd9210e151a2633ced69be 100644 (file)
@@ -1,6 +1,6 @@
 aspect X {
 before(): cflow(execution(* main(..))) && execution(* *(..)) {
-  System.out.println("AspectX>>"+thisJoinPointStaticPart);
+  System.out.println("X:"+thisJoinPointStaticPart);
 }
 
 }
index 961f489c1d7e42b4ed279b5d68677230a00bcaae..b7e3fcb918f4530076ebd45d7e1bfb38c026d89d 100644 (file)
@@ -10,7 +10,7 @@ aspect A {
   public void C.m() {}
 
   before(): execution(* C.main(..)) {
-    System.out.println("AspectA>>"+thisJoinPointStaticPart);
+    System.out.println("A:"+thisJoinPointStaticPart);
   }
 
 }
index 8c51d6072811c639a5b6fa68879d81911282a7a0..8eee320b9f0eb27e6558a655067b08b7f2263e40 100644 (file)
@@ -1,6 +1,6 @@
 aspect X {
 before(): execution(* *(..)) {
-  System.out.println("AspectX>>"+thisJoinPointStaticPart);
+  System.out.println("X:"+thisJoinPointStaticPart);
 }
 }
 
diff --git a/tests/features167/overweaving/messy2/A.aj b/tests/features167/overweaving/messy2/A.aj
new file mode 100644 (file)
index 0000000..78f5b99
--- /dev/null
@@ -0,0 +1,3 @@
+public aspect A {
+  before(): execution(* *(..)) {System.out.println("A:"+thisJoinPointStaticPart);}
+}
diff --git a/tests/features167/overweaving/messy2/B.aj b/tests/features167/overweaving/messy2/B.aj
new file mode 100644 (file)
index 0000000..d35d274
--- /dev/null
@@ -0,0 +1,3 @@
+public aspect B {
+  before(): execution(* *(..)) {System.out.println("B:"+thisJoinPointStaticPart);}
+}
diff --git a/tests/features167/overweaving/messy2/Class1.java b/tests/features167/overweaving/messy2/Class1.java
new file mode 100644 (file)
index 0000000..c89605c
--- /dev/null
@@ -0,0 +1,5 @@
+public class Class1 {
+  public static void main(String[]argv) {
+    System.out.println("Class1.main");
+  }
+}
diff --git a/tests/features167/overweaving/messy2/Class2.java b/tests/features167/overweaving/messy2/Class2.java
new file mode 100644 (file)
index 0000000..b602a2f
--- /dev/null
@@ -0,0 +1,5 @@
+public class Class2 {
+  public static void main(String[]argv) {
+    System.out.println("Class2.main");
+  }
+}
diff --git a/tests/features167/overweaving/messy2/aop.xml b/tests/features167/overweaving/messy2/aop.xml
new file mode 100644 (file)
index 0000000..956854a
--- /dev/null
@@ -0,0 +1,12 @@
+<aspectj>
+<aspects>
+  <aspect name="A"/>
+  <aspect name="B"/>
+</aspects>
+<weaver options="-verbose -Xset:overWeaving=true -debug -showWeaveInfo">
+<!--
+  <dump within="*" beforeandafter="true"/>
+-->
+</weaver>
+
+</aspectj>
index 373bae6b0366af8ffc064e52f5894e20a94e55ad..1ced76f5976f6a9969c90ef9b3b09089871d481f 100644 (file)
@@ -22,6 +22,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
  */
 public class OverweavingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testComplex() {
+               runTest("really messy");
+       }
+
        public void testSimple() {
                runTest("simple");
        }
index 84bed6486773f92c4cf814d4dff908779b5a27ef..358ab7d8526b8cc4bd721ffa76fcc45ab40d2bf9 100644 (file)
@@ -2,6 +2,28 @@
 
 <suite>
    
+   <ajc-test dir="features167/overweaving/messy2" title="really messy">
+     <compile files="A.aj Class1.java" options="-1.5"/>
+     <compile files="B.aj" options="-1.5 -Xlint:ignore"/>
+     <compile files="Class2.java" options="-1.5 -Xlint:ignore"/>
+     <run class="Class1" ltw="aop.xml">
+       <stdout>
+       <!-- should be advised by both, but was *already* advised by A during first weave -->
+         <line text="B:execution(void Class1.main(String[]))"/>
+         <line text="A:execution(void Class1.main(String[]))"/>
+         <line text="Class1.main"/>
+       </stdout>
+     </run>
+     
+     <run class="Class2" ltw="aop.xml">
+       <stdout>
+         <line text="A:execution(void Class2.main(String[]))"/>
+         <line text="B:execution(void Class2.main(String[]))"/>
+         <line text="Class2.main"/>
+       </stdout>
+     </run>
+   </ajc-test>
+   
    <ajc-test dir="features167/overweaving" title="simple">
      <compile files="A.aj C.java" options="-1.5"/>
      <compile files="X.aj" options="-1.5 -Xlint:ignore"/>
@@ -20,9 +42,9 @@
      <compile files="X.aj" options="-1.5 -Xlint:ignore"/>
      <run class="com.andy.C" ltw="aop.xml">
        <stdout>
-         <line text="AspectX&gt;&gt;execution(void com.andy.C.main(String[]))"/>
-         <line text="AspectA&gt;&gt;execution(void com.andy.C.main(String[]))"/>
-         <line text="AspectX&gt;&gt;execution(void com.andy.C.run())"/>
+         <line text="X:execution(void com.andy.C.main(String[]))"/>
+         <line text="A:execution(void com.andy.C.main(String[]))"/>
+         <line text="X:execution(void com.andy.C.run())"/>
          <line text="hello andy"/>
        </stdout>
      </run>
@@ -33,9 +55,9 @@
      <compile files="X.aj" options="-1.5 -Xlint:ignore"/>
      <run class="com.andy.C" ltw="aop.xml">
        <stdout>
-         <line text="AspectX&gt;&gt;execution(void com.andy.C.main(String[]))"/>
-         <line text="AspectA&gt;&gt;execution(void com.andy.C.main(String[]))"/>
-         <line text="AspectX&gt;&gt;execution(void com.andy.C.run())"/>
+         <line text="X:execution(void com.andy.C.main(String[]))"/>
+         <line text="A:execution(void com.andy.C.main(String[]))"/>
+         <line text="X:execution(void com.andy.C.run())"/>
          <line text="hello andy"/>
        </stdout>
      </run>