From e08f73a4b32ac78362e79b4b49e8a191dfc5d233 Mon Sep 17 00:00:00 2001 From: acolyer Date: Tue, 22 Nov 2005 09:47:59 +0000 Subject: [PATCH] tests for pr103097 --- tests/bugs150/Pr103097.aj | 23 +++++++++++++++++++ .../systemtest/ajc150/Ajc150Tests.java | 4 ++++ .../org/aspectj/systemtest/ajc150/ajc150.xml | 7 +++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/bugs150/Pr103097.aj diff --git a/tests/bugs150/Pr103097.aj b/tests/bugs150/Pr103097.aj new file mode 100644 index 000000000..e8e3cbb68 --- /dev/null +++ b/tests/bugs150/Pr103097.aj @@ -0,0 +1,23 @@ +import java.io.IOException; + +public aspect Pr103097 { + declare soft: IOException: + within(Pr103097) && + !withincode(* *(..)) && + !call(* *(..)); + + before() : execution(* main(..)) { + try { + doThrow(); + } catch (IOException e) { + throw new RuntimeException("IOException not softened as expected"); + } catch(org.aspectj.lang.SoftException ex) {} + } + + public static void doThrow() throws IOException { + throw new IOException("test"); + } + + public static void main(String args[]) { + } +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index d5df0462c..14833bc63 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -730,6 +730,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("declare soft and adviceexecution"); } + public void testDeclareSoftWithExclusions() { + runTest("declare soft and exclusions"); + } + /* * Load-time weaving bugs */ diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 120083cf7..7a19516b6 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -84,7 +84,12 @@ - + + + + + + -- 2.39.5