From 9e3a03d72645690f365b68404a3e8d0fc2aec76f Mon Sep 17 00:00:00 2001 From: jhugunin Date: Mon, 26 Jan 2004 20:57:17 +0000 Subject: tests for Bugzilla Bug 50641 Better binary compatibility for advice method names --- tests/bugs/binaryCompat/Main.java | 17 +++++++++++++++++ tests/bugs/binaryCompat/TraceRE.aj | 11 +++++++++++ tests/bugs/binaryCompat/TraceV1.aj | 11 +++++++++++ tests/bugs/binaryCompat/TraceV2.aj | 11 +++++++++++ 4 files changed, 50 insertions(+) create mode 100644 tests/bugs/binaryCompat/Main.java create mode 100644 tests/bugs/binaryCompat/TraceRE.aj create mode 100644 tests/bugs/binaryCompat/TraceV1.aj create mode 100644 tests/bugs/binaryCompat/TraceV2.aj (limited to 'tests/bugs') 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 -- cgit v1.2.3