summaryrefslogtreecommitdiffstats
path: root/weaver5/java5-testsrc
diff options
context:
space:
mode:
authoracolyer <acolyer>2006-05-05 14:08:35 +0000
committeracolyer <acolyer>2006-05-05 14:08:35 +0000
commitb954b2664c25a74062a5a75b3d99a99e5ddf176d (patch)
treeab9e87b4bfe7dfcd225343abd2da99e336993f00 /weaver5/java5-testsrc
parent299c3a4f2c5205102b89d63c4a8f1bccb158eef1 (diff)
downloadaspectj-b954b2664c25a74062a5a75b3d99a99e5ddf176d.tar.gz
aspectj-b954b2664c25a74062a5a75b3d99a99e5ddf176d.zip
test and fix for pr140357, reference pointcuts that refer to other reference pointcuts in the same type, in a reflective world...
Diffstat (limited to 'weaver5/java5-testsrc')
-rw-r--r--weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java
index 6127b2dd8..6e05580b9 100644
--- a/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java
+++ b/weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java
@@ -283,6 +283,22 @@ public class Java15PointcutExpressionTest extends TestCase {
assertTrue("should match",sm1.alwaysMatches());
}
+ public void testReferencePCsInSameType() throws Exception {
+ PointcutExpression ex = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.c()",NamedPointcutResolution.class,new PointcutParameter[0]);
+ ShadowMatch sm = ex.matchesMethodExecution(a);
+ assertTrue("should match",sm.alwaysMatches());
+ sm = ex.matchesMethodExecution(b);
+ assertTrue("does not match",sm.neverMatches());
+ }
+
+ public void testReferencePCsInOtherType() throws Exception {
+ PointcutExpression ex = parser.parsePointcutExpression("org.aspectj.weaver.tools.Java15PointcutExpressionTest.ExternalReferrer.d()",ExternalReferrer.class,new PointcutParameter[0]);
+ ShadowMatch sm = ex.matchesMethodExecution(a);
+ assertTrue("should match",sm.alwaysMatches());
+ sm = ex.matchesMethodExecution(b);
+ assertTrue("does not match",sm.neverMatches());
+ }
+
protected void setUp() throws Exception {
super.setUp();
parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(this.getClass().getClassLoader());
@@ -334,6 +350,26 @@ public class Java15PointcutExpressionTest extends TestCase {
static class GoldenOldie {
public void foo() {}
}
+
+ private static class NamedPointcutResolution {
+
+ @Pointcut("execution(* *(..))")
+ public void a() {}
+
+ @Pointcut("this(org.aspectj.weaver.tools.Java15PointcutExpressionTest.A)")
+ public void b() {}
+
+ @Pointcut("a() && b()")
+ public void c() {}
+ }
+
+ private static class ExternalReferrer {
+
+ @Pointcut("org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.a() && " +
+ "org.aspectj.weaver.tools.Java15PointcutExpressionTest.NamedPointcutResolution.b())")
+ public void d() {}
+
+ }
}