From 66625fd29e1c4e075415dde4740adeb44b811c40 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 29 Apr 2010 19:49:27 +0000 Subject: 307009: test and fix: declare soft and call joinpoint (matching on annotations) --- tests/bugs169/pr307009/Ann.java | 7 +++++++ tests/bugs169/pr307009/Bug.aj | 6 ++++++ tests/bugs169/pr307009/Test.java | 6 ++++++ tests/bugs169/pr307009/Test2.java | 7 +++++++ tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java | 8 ++++++++ tests/src/org/aspectj/systemtest/ajc169/ajc169.xml | 13 ++++++++++++- 6 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tests/bugs169/pr307009/Ann.java create mode 100644 tests/bugs169/pr307009/Bug.aj create mode 100644 tests/bugs169/pr307009/Test.java create mode 100644 tests/bugs169/pr307009/Test2.java (limited to 'tests') diff --git a/tests/bugs169/pr307009/Ann.java b/tests/bugs169/pr307009/Ann.java new file mode 100644 index 000000000..c6d768960 --- /dev/null +++ b/tests/bugs169/pr307009/Ann.java @@ -0,0 +1,7 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.CLASS) +public @interface Ann +{ +} + diff --git a/tests/bugs169/pr307009/Bug.aj b/tests/bugs169/pr307009/Bug.aj new file mode 100644 index 000000000..d7d94d083 --- /dev/null +++ b/tests/bugs169/pr307009/Bug.aj @@ -0,0 +1,6 @@ +public aspect Bug { + // works when specifying *.aj *.java, fails when using -sourceroots! + declare soft : Exception : call(@Ann * *(..)); + // this works in both cases! + //declare soft : Exception : call(* m2(..)); +} diff --git a/tests/bugs169/pr307009/Test.java b/tests/bugs169/pr307009/Test.java new file mode 100644 index 000000000..c93ce5801 --- /dev/null +++ b/tests/bugs169/pr307009/Test.java @@ -0,0 +1,6 @@ +public class Test +{ + public void m() { + new Test2().m2(); + } +} diff --git a/tests/bugs169/pr307009/Test2.java b/tests/bugs169/pr307009/Test2.java new file mode 100644 index 000000000..335232709 --- /dev/null +++ b/tests/bugs169/pr307009/Test2.java @@ -0,0 +1,7 @@ +public class Test2 +{ + @Ann + public void m2() throws Exception { + throw new Exception(); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java b/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java index e381e1b1d..040496b6c 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java @@ -18,6 +18,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc169Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testDeclareSoftCall_307009_1() { + runTest("declare soft and call - 1"); + } + + public void testDeclareSoftCall_307009_2() { + runTest("declare soft and call - 2"); + } + public void testAmbiguousMethod_298665() { runTest("ambiguous method"); } diff --git a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml index 06daa16cd..db502f80d 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml +++ b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml @@ -2,9 +2,20 @@ + + + + + + + + + + + + - -- cgit v1.2.3