From: jhugunin Date: Mon, 26 Jan 2004 20:57:17 +0000 (+0000) Subject: tests for Bugzilla Bug 50641 X-Git-Tag: v_preCompileLoopAlteration~68 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9e3a03d72645690f365b68404a3e8d0fc2aec76f;p=aspectj.git tests for Bugzilla Bug 50641 Better binary compatibility for advice method names --- 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