diff options
author | acolyer <acolyer> | 2005-11-04 13:13:09 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-11-04 13:13:09 +0000 |
commit | 6104d89dfa9af6f7f1f1853e04b498d5ea60a1c8 (patch) | |
tree | 2b3232b153e1166c738e2b361cc128c918e20b70 /tests | |
parent | 78569b96815838515cb9c9bc8ab528149a89af00 (diff) | |
download | aspectj-6104d89dfa9af6f7f1f1853e04b498d5ea60a1c8.tar.gz aspectj-6104d89dfa9af6f7f1f1853e04b498d5ea60a1c8.zip |
tests for pr73050 :- support for isAnonymous and name pattern matching that now only matches "*" against anonymous types
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/Pr73050.aj | 20 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 9 |
3 files changed, 33 insertions, 0 deletions
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 @@ </compile> </ajc-test> + <ajc-test dir="bugs150" title="Anonymous types and nome matching"> + <compile files="Pr73050.aj" outjar="jar1.jar"> + <message kind="warning" line="16" text="anonymous types should be matched by a * wild card"/> + </compile> + <compile inpath="jar1.jar"> + <message kind="warning" line="0" text="anonymous types should be matched by a * wild card"/> + </compile> + </ajc-test> + <ajc-test dir="bugs150/pr86903" title="bcelrenderer bad"> <compile files="GenericService.java,Service.java,Main.java,BadWormhole.java"/> <run class="Main"/> |