summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs/binaryCompat/Main.java17
-rw-r--r--tests/bugs/binaryCompat/TraceRE.aj11
-rw-r--r--tests/bugs/binaryCompat/TraceV1.aj11
-rw-r--r--tests/bugs/binaryCompat/TraceV2.aj11
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/bugs/binaryCompat/Main.java b/tests/bugs/binaryCompat/Main.java
new file mode 100644
index 000000000..d91978f9f
--- /dev/null
+++ b/tests/bugs/binaryCompat/Main.java
@@ -0,0 +1,17 @@
+public class Main {
+ public static void main(String[] args) {
+ try {
+ doit();
+ if (Trace.expectNoSuchMethodError) {
+ throw new RuntimeException("expected NoSuchMethodError");
+ }
+ } catch (NoSuchMethodError e) {
+ if (!Trace.expectNoSuchMethodError) throw e;
+ }
+
+ }
+
+ private static void doit() {
+ System.out.println("hello world");
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/binaryCompat/TraceRE.aj b/tests/bugs/binaryCompat/TraceRE.aj
new file mode 100644
index 000000000..72136ff20
--- /dev/null
+++ b/tests/bugs/binaryCompat/TraceRE.aj
@@ -0,0 +1,11 @@
+aspect Trace {
+ public static boolean expectNoSuchMethodError = true;
+
+ before(): execution(void main(..)) { // expect an error for incompatible binary change
+ System.out.println("enter");
+ }
+
+ after() returning: execution(void doit(..)) {
+ System.out.println("exit");
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/binaryCompat/TraceV1.aj b/tests/bugs/binaryCompat/TraceV1.aj
new file mode 100644
index 000000000..bb90e4a9c
--- /dev/null
+++ b/tests/bugs/binaryCompat/TraceV1.aj
@@ -0,0 +1,11 @@
+aspect Trace {
+ public static boolean expectNoSuchMethodError = false;
+
+ before(): execution(void doit(..)) {
+ System.out.println("enter");
+ }
+
+ after() returning: execution(void doit(..)) {
+ System.out.println("exit");
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/binaryCompat/TraceV2.aj b/tests/bugs/binaryCompat/TraceV2.aj
new file mode 100644
index 000000000..c71416af3
--- /dev/null
+++ b/tests/bugs/binaryCompat/TraceV2.aj
@@ -0,0 +1,11 @@
+aspect Trace {
+ public static boolean expectNoSuchMethodError = false;
+
+ before(): execution(void doit(..)) {
+ System.out.println("entering");
+ }
+
+ after() returning: execution(void doit(..)) {
+ System.out.println("exiting");
+ }
+} \ No newline at end of file