summaryrefslogtreecommitdiffstats
path: root/aspectj5rt/java5-testsrc
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-06-17 09:24:30 +0000
committeracolyer <acolyer>2005-06-17 09:24:30 +0000
commit9961155d58379dbcc3a442950d558d0ccd42430e (patch)
treeae94fb5fd5a54284f6383661de671efe6ada7157 /aspectj5rt/java5-testsrc
parentd766e29a11602e044a58f77e24725fcdd2b34f0a (diff)
downloadaspectj-9961155d58379dbcc3a442950d558d0ccd42430e.tar.gz
aspectj-9961155d58379dbcc3a442950d558d0ccd42430e.zip
updated reflection interfaces to represent a pointcut expression as a PointcutExpression rather than as a String. This abstraction is needed to support runtime creation and matching of pointcut expressions down the line.
Note that the whole MAP support in this module is still a work in progress and is scheduled for completion in M4. -- AMC.
Diffstat (limited to 'aspectj5rt/java5-testsrc')
-rw-r--r--aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java
index 1ecd34516..8d0820ecc 100644
--- a/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java
+++ b/aspectj5rt/java5-testsrc/org/aspectj/internal/lang/reflect/AjTypeTestsWithAspects.java
@@ -56,23 +56,23 @@ public class AjTypeTestsWithAspects extends TestCase {
PerClause pc = perThisA.getPerClause();
assertEquals(PerClauseKind.PERTHIS,pc.getKind());
- assertEquals("pc()",pc.getPointcutExpression());
+ assertEquals("pc()",pc.getPointcutExpression().toString());
pc= perTargetA.getPerClause();
assertEquals(PerClauseKind.PERTARGET,pc.getKind());
- assertEquals("pc()",pc.getPointcutExpression());
+ assertEquals("pc()",pc.getPointcutExpression().toString());
pc= perCflowA.getPerClause();
assertEquals(PerClauseKind.PERCFLOW,pc.getKind());
- assertEquals("pc()",pc.getPointcutExpression());
+ assertEquals("pc()",pc.getPointcutExpression().toString());
pc= perCflowbelowA.getPerClause();
assertEquals(PerClauseKind.PERCFLOWBELOW,pc.getKind());
- assertEquals("pc()",pc.getPointcutExpression());
+ assertEquals("pc()",pc.getPointcutExpression().toString());
pc= perTypeWithinA.getPerClause();
assertEquals(PerClauseKind.PERTYPEWITHIN,pc.getKind());
- assertEquals("org.aspectj..*",pc.getPointcutExpression());
+ assertEquals("org.aspectj..*",pc.getPointcutExpression().toString());
}
@@ -143,13 +143,13 @@ public class AjTypeTestsWithAspects extends TestCase {
public void testGetDeclaredPointcut() throws Exception {
Pointcut p1 = sa.getDeclaredPointcut("simpleAspectMethodExecution");
assertEquals("simpleAspectMethodExecution",p1.getName());
- assertEquals("execution(* SimpleAspect.*(..))",p1.getPointcutExpression());
+ assertEquals("execution(* SimpleAspect.*(..))",p1.getPointcutExpression().toString());
assertEquals(sa,p1.getDeclaringType());
assertEquals(0,p1.getParameterTypes().length);
assertTrue(Modifier.isPublic(p1.getModifiers()));
Pointcut p2 = sa.getDeclaredPointcut("simpleAspectCall");
assertEquals("simpleAspectCall",p2.getName());
- assertEquals("call(* SimpleAspect.*(..))",p2.getPointcutExpression());
+ assertEquals("call(* SimpleAspect.*(..))",p2.getPointcutExpression().toString());
assertEquals(sa,p2.getDeclaringType());
assertEquals(1,p2.getParameterTypes().length);
assertTrue(Modifier.isPrivate(p2.getModifiers()));
@@ -164,13 +164,13 @@ public class AjTypeTestsWithAspects extends TestCase {
public void testGetPointcut() throws Exception {
Pointcut p1 = sa.getPointcut("simpleAspectMethodExecution");
assertEquals("simpleAspectMethodExecution",p1.getName());
- assertEquals("execution(* SimpleAspect.*(..))",p1.getPointcutExpression());
+ assertEquals("execution(* SimpleAspect.*(..))",p1.getPointcutExpression().toString());
assertEquals(sa,p1.getDeclaringType());
assertEquals(0,p1.getParameterTypes().length);
assertTrue(Modifier.isPublic(p1.getModifiers()));
Pointcut p2 = sa.getPointcut("simpleAspectCall");
assertEquals("simpleAspectCall",p2.getName());
- assertEquals("call(* SimpleAspect.*(..))",p2.getPointcutExpression());
+ assertEquals("call(* SimpleAspect.*(..))",p2.getPointcutExpression().toString());
assertEquals(sa,p2.getDeclaringType());
assertEquals(1,p2.getParameterTypes().length);
assertTrue(Modifier.isPrivate(p2.getModifiers()));
@@ -212,10 +212,10 @@ public class AjTypeTestsWithAspects extends TestCase {
assertEquals(4,advice.length);
advice = sa.getDeclaredAdvice(AdviceType.BEFORE);
- assertEquals("execution(* SimpleAspect.*(..))",advice[0].getPointcutExpression());
+ assertEquals("execution(* SimpleAspect.*(..))",advice[0].getPointcutExpression().toString());
assertEquals("logEntry",advice[0].getName());
assertEquals(AdviceType.BEFORE,advice[0].getKind());
- assertEquals("execution(* SimpleAspect.*(..))",advice[1].getPointcutExpression());
+ assertEquals("execution(* SimpleAspect.*(..))",advice[1].getPointcutExpression().toString());
assertEquals("",advice[1].getName());
}
@@ -304,11 +304,11 @@ public class AjTypeTestsWithAspects extends TestCase {
if (deow.isError()) {
if (deow.getMessage().equals("dont call this method code")) foundCodeError = true;
if (deow.getMessage().equals("dont call this method ann")) foundAnnError = true;
- assertEquals("call(* DontDoIt.*(..))",deow.getPointcutExpression());
+ assertEquals("call(* DontDoIt.*(..))",deow.getPointcutExpression().toString());
} else {
if (deow.getMessage().equals("dont call this method code")) foundCodeWarning = true;
if (deow.getMessage().equals("dont call this method ann")) foundAnnWarning = true;
- assertEquals("call(* DontDoIt.*(..))",deow.getPointcutExpression());
+ assertEquals("call(* DontDoIt.*(..))",deow.getPointcutExpression().toString());
}
}
assertTrue(foundCodeWarning && foundAnnWarning && foundCodeError && foundAnnError);