aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/testsrc
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-06-09 15:44:29 +0000
committeracolyer <acolyer>2004-06-09 15:44:29 +0000
commit0ffb7cb8f5b01873495f1d419e4f59c13816325c (patch)
tree09fbb7ca8a9c18b2129d572b0d7f8f8e8fa10d34 /weaver/testsrc
parenta410567f2d9da6df3cfa51af84a6f7bc5a9c0418 (diff)
downloadaspectj-0ffb7cb8f5b01873495f1d419e4f59c13816325c.tar.gz
aspectj-0ffb7cb8f5b01873495f1d419e4f59c13816325c.zip
ensure args() handles boxed primitives correctly when doing
runtime matching (against JoinPoint)
Diffstat (limited to 'weaver/testsrc')
-rw-r--r--weaver/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java24
-rw-r--r--weaver/testsrc/org/aspectj/weaver/patterns/KindedTestCase.java2
2 files changed, 26 insertions, 0 deletions
diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java
index 92c27f05e..36004cfc5 100644
--- a/weaver/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java
+++ b/weaver/testsrc/org/aspectj/weaver/patterns/ArgsTestCase.java
@@ -69,6 +69,30 @@ public class ArgsTestCase extends TestCase {
}
+ public void testMatchJPWithPrimitiveTypes() {
+ try {
+ Factory f = new Factory("ArgsTestCase.java",ArgsTestCase.A.class);
+
+ Pointcut oneInt = new PatternParser("args(int)").parsePointcut().resolve();
+ Pointcut oneInteger = new PatternParser("args(Integer)").parsePointcut().resolve();
+
+ JoinPoint.StaticPart oneIntjp = f.makeSJP(JoinPoint.METHOD_EXECUTION,f.makeMethodSig(0,"aMethod",A.class,new Class[] {int.class},new String[] {"i"},new Class[] {},null) ,1);
+ JoinPoint.StaticPart oneIntegerjp = f.makeSJP(JoinPoint.METHOD_EXECUTION,f.makeMethodSig(0,"aMethod",A.class,new Class[] {Integer.class},new String[] {"i"},new Class[] {},null),1);
+
+ JoinPoint oneIntArg = Factory.makeJP(oneIntjp,new A(),new A(),new Integer(3));
+ JoinPoint oneIntegerArg = Factory.makeJP(oneIntegerjp,new A(), new A(), new Integer(7));
+
+ checkMatches(oneInt,oneIntArg,null,FuzzyBoolean.YES);
+ checkMatches(oneInt,oneIntegerArg,null,FuzzyBoolean.NO);
+ checkMatches(oneInteger,oneIntArg,null,FuzzyBoolean.NO);
+ checkMatches(oneInteger,oneIntegerArg,null,FuzzyBoolean.YES);
+
+ } catch( Exception ex) {
+ fail("Unexpected exception " + ex);
+ }
+
+ }
+
private void checkMatches(Pointcut p, JoinPoint jp, JoinPoint.StaticPart jpsp, FuzzyBoolean expected) {
assertEquals(expected,p.match(jp,jpsp));
}
diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/KindedTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/KindedTestCase.java
index 0da791619..d344f89f7 100644
--- a/weaver/testsrc/org/aspectj/weaver/patterns/KindedTestCase.java
+++ b/weaver/testsrc/org/aspectj/weaver/patterns/KindedTestCase.java
@@ -49,6 +49,7 @@ public class KindedTestCase extends TestCase {
JoinPoint.StaticPart execonsjp2 = f.makeSJP(JoinPoint.CONSTRUCTOR_EXECUTION,f.makeConstructorSig(0,String.class,new Class[] {String.class},new String[]{"s"},new Class[0]),1);
JoinPoint.StaticPart initjp1 = f.makeSJP(JoinPoint.INITIALIZATION,f.makeConstructorSig(0,Hello.class,new Class[0],new String[0],new Class[0]),1);
JoinPoint.StaticPart initjp2 = f.makeSJP(JoinPoint.PREINTIALIZATION,f.makeConstructorSig(0,Hello.class,new Class[]{int.class, int.class},new String[]{"a","b"},new Class[0]),1);
+ JoinPoint.StaticPart initjp3 = f.makeSJP(JoinPoint.PREINTIALIZATION,f.makeConstructorSig(0,Hello.class,new Class[]{Integer.class, Integer.class},new String[]{"a","b"},new Class[0]),1);
JoinPoint.StaticPart sinitjp1 = f.makeSJP(JoinPoint.STATICINITIALIZATION,f.makeInitializerSig(Modifier.STATIC,Hello.class),1);
JoinPoint.StaticPart sinitjp2 = f.makeSJP(JoinPoint.STATICINITIALIZATION,f.makeInitializerSig(Modifier.STATIC,String.class),1);
JoinPoint.StaticPart getjp1 = f.makeSJP(JoinPoint.FIELD_GET,f.makeFieldSig(0,"x",Hello.class,int.class),1);
@@ -71,6 +72,7 @@ public class KindedTestCase extends TestCase {
checkMatches(initpc,initjp2,FuzzyBoolean.NO);
checkMatches(preinitpc,initjp1,FuzzyBoolean.NO);
checkMatches(preinitpc,initjp2,FuzzyBoolean.YES);
+ checkMatches(preinitpc,initjp3,FuzzyBoolean.NO);
checkMatches(staticinitpc,sinitjp1,FuzzyBoolean.YES);
checkMatches(staticinitpc,sinitjp2,FuzzyBoolean.NO);
checkMatches(getpc,getjp1,FuzzyBoolean.YES);