summaryrefslogtreecommitdiffstats
path: root/tests/ltw/callMunging/case1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ltw/callMunging/case1')
-rw-r--r--tests/ltw/callMunging/case1/A.java7
-rw-r--r--tests/ltw/callMunging/case1/Main.java17
-rw-r--r--tests/ltw/callMunging/case1/T.java3
-rw-r--r--tests/ltw/callMunging/case1/X.java9
-rw-r--r--tests/ltw/callMunging/case1/aop.xml7
-rw-r--r--tests/ltw/callMunging/case1/readme.txt1
6 files changed, 44 insertions, 0 deletions
diff --git a/tests/ltw/callMunging/case1/A.java b/tests/ltw/callMunging/case1/A.java
new file mode 100644
index 000000000..23950c6a2
--- /dev/null
+++ b/tests/ltw/callMunging/case1/A.java
@@ -0,0 +1,7 @@
+public class A {
+ T t = new T();
+ public void method() {
+ System.out.println("A.method() running");
+ t.m1();
+ }
+}
diff --git a/tests/ltw/callMunging/case1/Main.java b/tests/ltw/callMunging/case1/Main.java
new file mode 100644
index 000000000..8466ce953
--- /dev/null
+++ b/tests/ltw/callMunging/case1/Main.java
@@ -0,0 +1,17 @@
+import java.lang.reflect.Method;
+
+public class Main {
+
+ public static void main(String []argv) {
+ try {
+ System.out.println("into:main");
+ Class clazzA = Class.forName("A");
+ Method clazzAMethod = clazzA.getMethod("method",null);
+ clazzAMethod.invoke(clazzA.newInstance(),null);
+ System.out.println("leave:main");
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+}
diff --git a/tests/ltw/callMunging/case1/T.java b/tests/ltw/callMunging/case1/T.java
new file mode 100644
index 000000000..9e177ba89
--- /dev/null
+++ b/tests/ltw/callMunging/case1/T.java
@@ -0,0 +1,3 @@
+public class T {
+ public void m1() {System.out.println("T.m1() running");}
+}
diff --git a/tests/ltw/callMunging/case1/X.java b/tests/ltw/callMunging/case1/X.java
new file mode 100644
index 000000000..836aa7bbf
--- /dev/null
+++ b/tests/ltw/callMunging/case1/X.java
@@ -0,0 +1,9 @@
+import java.io.Serializable;
+
+public aspect X {
+ declare parents: T implements Serializable;
+
+ before(): call(* Serializable+.m*(..)) {
+ System.out.println("advice running");
+ }
+}
diff --git a/tests/ltw/callMunging/case1/aop.xml b/tests/ltw/callMunging/case1/aop.xml
new file mode 100644
index 000000000..321117898
--- /dev/null
+++ b/tests/ltw/callMunging/case1/aop.xml
@@ -0,0 +1,7 @@
+<aspectj>
+<weaver options="-showWeaveInfo -verbose"/>
+<aspects>
+<aspect name="X"/>
+</aspects>
+</aspectj>
+
diff --git a/tests/ltw/callMunging/case1/readme.txt b/tests/ltw/callMunging/case1/readme.txt
new file mode 100644
index 000000000..c3c00dd9f
--- /dev/null
+++ b/tests/ltw/callMunging/case1/readme.txt
@@ -0,0 +1 @@
+Basic case, where type T needs munging with a declare parents before the join point in A.method() are matched. \ No newline at end of file