]> source.dussan.org Git - aspectj.git/commitdiff
tests for Bugzilla Bug 50641
authorjhugunin <jhugunin>
Mon, 26 Jan 2004 20:57:17 +0000 (20:57 +0000)
committerjhugunin <jhugunin>
Mon, 26 Jan 2004 20:57:17 +0000 (20:57 +0000)
   Better binary compatibility for advice method names

tests/bugs/binaryCompat/Main.java [new file with mode: 0644]
tests/bugs/binaryCompat/TraceRE.aj [new file with mode: 0644]
tests/bugs/binaryCompat/TraceV1.aj [new file with mode: 0644]
tests/bugs/binaryCompat/TraceV2.aj [new file with mode: 0644]

diff --git a/tests/bugs/binaryCompat/Main.java b/tests/bugs/binaryCompat/Main.java
new file mode 100644 (file)
index 0000000..d91978f
--- /dev/null
@@ -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 (file)
index 0000000..72136ff
--- /dev/null
@@ -0,0 +1,11 @@
+aspect Trace {\r
+       public static boolean expectNoSuchMethodError = true;\r
+       \r
+       before(): execution(void main(..)) {  // expect an error for incompatible binary change\r
+               System.out.println("enter");\r
+       }\r
+       \r
+       after() returning: execution(void doit(..)) {\r
+               System.out.println("exit");\r
+       }\r
+}
\ No newline at end of file
diff --git a/tests/bugs/binaryCompat/TraceV1.aj b/tests/bugs/binaryCompat/TraceV1.aj
new file mode 100644 (file)
index 0000000..bb90e4a
--- /dev/null
@@ -0,0 +1,11 @@
+aspect Trace {\r
+       public static boolean expectNoSuchMethodError = false;\r
+       \r
+       before(): execution(void doit(..)) {\r
+               System.out.println("enter");\r
+       }\r
+       \r
+       after() returning: execution(void doit(..)) {\r
+               System.out.println("exit");\r
+       }\r
+}
\ No newline at end of file
diff --git a/tests/bugs/binaryCompat/TraceV2.aj b/tests/bugs/binaryCompat/TraceV2.aj
new file mode 100644 (file)
index 0000000..c71416a
--- /dev/null
@@ -0,0 +1,11 @@
+aspect Trace {\r
+       public static boolean expectNoSuchMethodError = false;\r
+       \r
+       before(): execution(void doit(..)) {\r
+               System.out.println("entering");\r
+       }\r
+       \r
+       after() returning: execution(void doit(..)) {\r
+               System.out.println("exiting");\r
+       }\r
+}
\ No newline at end of file