From 6104d89dfa9af6f7f1f1853e04b498d5ea60a1c8 Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 4 Nov 2005 13:13:09 +0000 Subject: [PATCH] tests for pr73050 :- support for isAnonymous and name pattern matching that now only matches "*" against anonymous types --- tests/bugs150/Pr73050.aj | 20 +++++++++++++++++++ .../systemtest/ajc150/Ajc150Tests.java | 4 ++++ .../org/aspectj/systemtest/ajc150/ajc150.xml | 9 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/bugs150/Pr73050.aj diff --git a/tests/bugs150/Pr73050.aj b/tests/bugs150/Pr73050.aj new file mode 100644 index 000000000..ed0168c60 --- /dev/null +++ b/tests/bugs150/Pr73050.aj @@ -0,0 +1,20 @@ +public aspect Pr73050 { + + pointcut anonymousTypeMatchedByNamePattern() : + staticinitialization(Pr73050.*1*); + + pointcut anonymousTypeMatchedByWildCard() : + staticinitialization(Pr73050.*); + + declare warning : anonymousTypeMatchedByNamePattern() : + "anonymous types shouldn't be matched by name patterns"; + + declare warning : anonymousTypeMatchedByWildCard() : + "anonymous types should be matched by a * wild card"; + + public void foo() { + (new Runnable() { + public void run() {} + }).run(); + } +} \ 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 26c4d16fc..daa45d8b3 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -665,6 +665,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("java 5 pointcuts and declares at pre-java 5 compliance levels"); } + public void testAnonymousTypes() { + runTest("Anonymous types and nome matching"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index ee03eea74..2f43ab7d3 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -50,6 +50,15 @@ + + + + + + + + + -- 2.39.5