aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2010-05-13 17:21:53 +0000
committeraclement <aclement>2010-05-13 17:21:53 +0000
commit511e100a81fd864f2f989becfe1405f1be9bb3e0 (patch)
tree9a27e16915c13cd130950646b8edabbf22e85416 /tests
parent0fdf5483d94c50119dab88c35dbaaa62650bd7eb (diff)
downloadaspectj-511e100a81fd864f2f989becfe1405f1be9bb3e0.tar.gz
aspectj-511e100a81fd864f2f989becfe1405f1be9bb3e0.zip
overweaving and tjp
Diffstat (limited to 'tests')
-rw-r--r--tests/features167/overweaving/callsTJP/A.aj3
-rw-r--r--tests/features167/overweaving/callsTJP/B.aj4
-rw-r--r--tests/features167/overweaving/callsTJP/Class1.java5
-rw-r--r--tests/features167/overweaving/callsTJP/Class2.java5
-rw-r--r--tests/features167/overweaving/callsTJP/aop.xml12
-rw-r--r--tests/features167/overweaving/getsetTJP/A.aj3
-rw-r--r--tests/features167/overweaving/getsetTJP/B.aj3
-rw-r--r--tests/features167/overweaving/getsetTJP/Class1.java6
-rw-r--r--tests/features167/overweaving/getsetTJP/Class2.java6
-rw-r--r--tests/features167/overweaving/getsetTJP/aop.xml12
-rw-r--r--tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java8
-rw-r--r--tests/src/org/aspectj/systemtest/ajc167/overweaving.xml47
12 files changed, 113 insertions, 1 deletions
diff --git a/tests/features167/overweaving/callsTJP/A.aj b/tests/features167/overweaving/callsTJP/A.aj
new file mode 100644
index 000000000..87bbabf6c
--- /dev/null
+++ b/tests/features167/overweaving/callsTJP/A.aj
@@ -0,0 +1,3 @@
+public aspect A {
+ before(): !cflow(adviceexecution()) && call(* *(..)) {System.out.println("A:"+thisJoinPoint);}
+}
diff --git a/tests/features167/overweaving/callsTJP/B.aj b/tests/features167/overweaving/callsTJP/B.aj
new file mode 100644
index 000000000..6c985367b
--- /dev/null
+++ b/tests/features167/overweaving/callsTJP/B.aj
@@ -0,0 +1,4 @@
+public aspect B {
+ declare precedence: B,*;
+ before(): !cflow(adviceexecution()) && call(* *(..)) {System.out.println("B:"+thisJoinPoint);}
+}
diff --git a/tests/features167/overweaving/callsTJP/Class1.java b/tests/features167/overweaving/callsTJP/Class1.java
new file mode 100644
index 000000000..c89605ca0
--- /dev/null
+++ b/tests/features167/overweaving/callsTJP/Class1.java
@@ -0,0 +1,5 @@
+public class Class1 {
+ public static void main(String[]argv) {
+ System.out.println("Class1.main");
+ }
+}
diff --git a/tests/features167/overweaving/callsTJP/Class2.java b/tests/features167/overweaving/callsTJP/Class2.java
new file mode 100644
index 000000000..b602a2fe9
--- /dev/null
+++ b/tests/features167/overweaving/callsTJP/Class2.java
@@ -0,0 +1,5 @@
+public class Class2 {
+ public static void main(String[]argv) {
+ System.out.println("Class2.main");
+ }
+}
diff --git a/tests/features167/overweaving/callsTJP/aop.xml b/tests/features167/overweaving/callsTJP/aop.xml
new file mode 100644
index 000000000..956854a9e
--- /dev/null
+++ b/tests/features167/overweaving/callsTJP/aop.xml
@@ -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>
diff --git a/tests/features167/overweaving/getsetTJP/A.aj b/tests/features167/overweaving/getsetTJP/A.aj
new file mode 100644
index 000000000..85e5d1f5e
--- /dev/null
+++ b/tests/features167/overweaving/getsetTJP/A.aj
@@ -0,0 +1,3 @@
+public aspect A {
+ before(): !cflow(adviceexecution()) && get(* *) {System.out.println("A:"+thisJoinPoint);}
+}
diff --git a/tests/features167/overweaving/getsetTJP/B.aj b/tests/features167/overweaving/getsetTJP/B.aj
new file mode 100644
index 000000000..5c36c4a76
--- /dev/null
+++ b/tests/features167/overweaving/getsetTJP/B.aj
@@ -0,0 +1,3 @@
+public aspect B {
+ before(): !cflow(adviceexecution()) && set(* *) {System.out.println("B:"+thisJoinPoint);}
+}
diff --git a/tests/features167/overweaving/getsetTJP/Class1.java b/tests/features167/overweaving/getsetTJP/Class1.java
new file mode 100644
index 000000000..029c8d831
--- /dev/null
+++ b/tests/features167/overweaving/getsetTJP/Class1.java
@@ -0,0 +1,6 @@
+public class Class1 {
+ public static String message = "Class1.main";
+ public static void main(String[]argv) {
+ System.out.println(message);
+ }
+}
diff --git a/tests/features167/overweaving/getsetTJP/Class2.java b/tests/features167/overweaving/getsetTJP/Class2.java
new file mode 100644
index 000000000..5e3c6cf3c
--- /dev/null
+++ b/tests/features167/overweaving/getsetTJP/Class2.java
@@ -0,0 +1,6 @@
+public class Class2 {
+ public static String message = "Class2.main";
+ public static void main(String[]argv) {
+ System.out.println(message);
+ }
+}
diff --git a/tests/features167/overweaving/getsetTJP/aop.xml b/tests/features167/overweaving/getsetTJP/aop.xml
new file mode 100644
index 000000000..956854a9e
--- /dev/null
+++ b/tests/features167/overweaving/getsetTJP/aop.xml
@@ -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>
diff --git a/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java b/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
index e29bd3349..daff18842 100644
--- a/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
@@ -33,6 +33,10 @@ public class OverweavingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("getset - 2"); // testing what actually happens when overweaving
}
+ public void testGetSetTjp1() {
+ runTest("getset - tjp - 1");
+ }
+
public void testCalls1() {
runTest("calls - 1"); // testing what should happen for calls
}
@@ -41,6 +45,10 @@ public class OverweavingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("calls - 2"); // testing what actually happens when overweaving
}
+ public void testCallsTjp1() {
+ runTest("calls - tjp - 1");
+ }
+
public void testComplex() {
runTest("really messy");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml b/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml
index 159bcf772..73f449aaa 100644
--- a/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml
+++ b/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml
@@ -2,7 +2,6 @@
<suite>
-
<ajc-test dir="features167/overweaving/getset" title="getset - 1">
<compile files="A.aj B.aj Class1.java Class2.java" options="-1.5"/>
<run class="Class1">
@@ -47,6 +46,30 @@
</stdout>
</run>
</ajc-test>
+
+ <ajc-test dir="features167/overweaving/getsettjp" title="getset - tjp - 1">
+ <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:set(String Class1.message)"/>
+ <line text="A:get(PrintStream java.lang.System.out)"/>
+ <line text="A:get(String Class1.message)"/>
+ <line text="Class1.main"/>
+ </stdout>
+ </run>
+
+ <run class="Class2" ltw="aop.xml">
+ <stdout>
+ <line text="B:set(String Class2.message)"/>
+ <line text="A:get(PrintStream java.lang.System.out)"/>
+ <line text="A:get(String Class2.message)"/>
+ <line text="Class2.main"/>
+ </stdout>
+ </run>
+ </ajc-test>
<ajc-test dir="features167/overweaving/calls" title="calls - 1">
<compile files="A.aj B.aj Class1.java Class2.java" options="-1.5"/>
@@ -89,6 +112,28 @@
</run>
</ajc-test>
+ <ajc-test dir="features167/overweaving/callstjp" title="calls - tjp - 1">
+ <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="A:call(void java.io.PrintStream.println(String))"/>
+ <line text="B:call(void java.io.PrintStream.println(String))"/>
+ <line text="Class1.main"/>
+ </stdout>
+ </run>
+
+ <run class="Class2" ltw="aop.xml">
+ <stdout>
+ <line text="B:call(void java.io.PrintStream.println(String))"/>
+ <line text="A:call(void java.io.PrintStream.println(String))"/>
+ <line text="Class2.main"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<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"/>