aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/testsrc
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-02-17 21:11:31 +0000
committeracolyer <acolyer>2005-02-17 21:11:31 +0000
commit900e12978dc17c3f9d7842764a48653712578e9b (patch)
tree7769a4926bd291dd0b45742ecb7d59a5facd2801 /weaver/testsrc
parentfdc14b8ff96b4a3c16b7cdf933c16fd9320ee3c1 (diff)
downloadaspectj-900e12978dc17c3f9d7842764a48653712578e9b.tar.gz
aspectj-900e12978dc17c3f9d7842764a48653712578e9b.zip
@xxx(@Foo) -> @xxx(Foo)
Diffstat (limited to 'weaver/testsrc')
-rw-r--r--weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java9
-rw-r--r--weaver/testsrc/org/aspectj/weaver/patterns/ParserTestCase.java28
-rw-r--r--weaver/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java14
3 files changed, 25 insertions, 26 deletions
diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java
index 464d2e9ec..136ab98fa 100644
--- a/weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java
+++ b/weaver/testsrc/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java
@@ -110,7 +110,7 @@ public class AnnotationPatternTestCase extends TestCase {
}
public void testParseNameOrVarAnnotationPattern() {
- PatternParser p = new PatternParser("@Foo");
+ PatternParser p = new PatternParser("Foo");
AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
assertEquals("Foo",TypeX.forName("Foo"),((ExactAnnotationTypePattern)foo).annotationType);
@@ -127,7 +127,7 @@ public class AnnotationPatternTestCase extends TestCase {
}
public void testParseNameOrVarAnnotationPatternWithOr() {
- PatternParser p = new PatternParser("@Foo || @Boo");
+ PatternParser p = new PatternParser("Foo || Boo");
AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
// rest of pattern not consumed...
assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
@@ -138,12 +138,11 @@ public class AnnotationPatternTestCase extends TestCase {
PatternParser p = new PatternParser("foo");
AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
assertTrue("ExactAnnotationTypePattern",foo instanceof ExactAnnotationTypePattern);
- assertNull("no type pattern yet",((ExactAnnotationTypePattern)foo).annotationType);
- assertEquals("foo",((ExactAnnotationTypePattern)foo).formalName);
+ assertEquals("@foo",((ExactAnnotationTypePattern)foo).toString());
}
public void testParseNameOrVarAnnotationPatternWithAnd() {
- PatternParser p = new PatternParser("@Foo @Boo");
+ PatternParser p = new PatternParser("Foo Boo");
AnnotationTypePattern foo = p.parseAnnotationNameOrVarTypePattern();
// rest of pattern not consumed...
assertEquals("@Foo",foo.toString());
diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/ParserTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/ParserTestCase.java
index 8854f3e11..c800427d0 100644
--- a/weaver/testsrc/org/aspectj/weaver/patterns/ParserTestCase.java
+++ b/weaver/testsrc/org/aspectj/weaver/patterns/ParserTestCase.java
@@ -152,13 +152,13 @@ public class ParserTestCase extends TestCase {
}
public void testAtAnnotation() {
- PatternParser parser = new PatternParser("@annotation(@Foo)");
+ PatternParser parser = new PatternParser("@annotation(Foo)");
AnnotationPointcut p = (AnnotationPointcut) parser.parsePointcut();
- assertEquals("@annotation(@Foo)",p.toString());
+ assertEquals("@annotation(Foo)",p.toString());
}
public void testBadAtAnnotation() {
- PatternParser parser = new PatternParser("@annotation(!@Foo)");
+ PatternParser parser = new PatternParser("@annotation(!Foo)");
try {
Pointcut p = parser.parsePointcut();
fail("Expected parser exception");
@@ -174,7 +174,7 @@ public class ParserTestCase extends TestCase {
}
public void testDoubleAtAnnotation() {
- PatternParser parser = new PatternParser("@annotation(@Foo @Goo)");
+ PatternParser parser = new PatternParser("@annotation(Foo Goo)");
try {
Pointcut p = parser.parsePointcut();
fail("Expected parser exception");
@@ -187,18 +187,18 @@ public class ParserTestCase extends TestCase {
PatternParser parser = new PatternParser("@within(foo)");
WithinAnnotationPointcut p = (WithinAnnotationPointcut) parser.parsePointcut();
assertEquals("@within(foo)",p.toString());
- parser = new PatternParser("@within(@Foo))");
+ parser = new PatternParser("@within(Foo))");
p = (WithinAnnotationPointcut) parser.parsePointcut();
- assertEquals("@within(@Foo)",p.toString());
+ assertEquals("@within(Foo)",p.toString());
}
public void testAtWithinCode() {
PatternParser parser = new PatternParser("@withincode(foo)");
WithinCodeAnnotationPointcut p = (WithinCodeAnnotationPointcut) parser.parsePointcut();
assertEquals("@withincode(foo)",p.toString());
- parser = new PatternParser("@withincode(@Foo))");
+ parser = new PatternParser("@withincode(Foo))");
p = (WithinCodeAnnotationPointcut) parser.parsePointcut();
- assertEquals("@withincode(@Foo)",p.toString());
+ assertEquals("@withincode(Foo)",p.toString());
}
public void testAtThis() {
@@ -206,10 +206,10 @@ public class ParserTestCase extends TestCase {
ThisOrTargetAnnotationPointcut p = (ThisOrTargetAnnotationPointcut) parser.parsePointcut();
assertEquals("@this(foo)",p.toString());
assertTrue("isThis",p.isThis());
- parser = new PatternParser("@this(@Foo))");
+ parser = new PatternParser("@this(Foo))");
p = (ThisOrTargetAnnotationPointcut) parser.parsePointcut();
assertTrue("isThis",p.isThis());
- assertEquals("@this(@Foo)",p.toString());
+ assertEquals("@this(Foo)",p.toString());
}
public void testAtTarget() {
@@ -217,16 +217,16 @@ public class ParserTestCase extends TestCase {
ThisOrTargetAnnotationPointcut p = (ThisOrTargetAnnotationPointcut) parser.parsePointcut();
assertEquals("@target(foo)",p.toString());
assertTrue("isTarget",!p.isThis());
- parser = new PatternParser("@target(@Foo))");
+ parser = new PatternParser("@target(Foo))");
p = (ThisOrTargetAnnotationPointcut) parser.parsePointcut();
assertTrue("isTarget",!p.isThis());
- assertEquals("@target(@Foo)",p.toString());
+ assertEquals("@target(Foo)",p.toString());
}
public void testAtArgs() {
- PatternParser parser = new PatternParser("@args(@Foo,@Goo,*,..,@Moo)");
+ PatternParser parser = new PatternParser("@args(Foo,Goo,*,..,Moo)");
Pointcut p = parser.parsePointcut();
- assertEquals("@args(@Foo, @Goo, @ANY, .., @Moo)",p.toString());
+ assertEquals("@args(Foo, Goo, ANY, .., Moo)",p.toString());
}
public TestScope makeSimpleScope() {
diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java b/weaver/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
index 14a19e0de..f28a5a7ac 100644
--- a/weaver/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
+++ b/weaver/testsrc/org/aspectj/weaver/patterns/PointcutRewriterTest.java
@@ -289,7 +289,7 @@ public class PointcutRewriterTest extends TestCase {
}
}
// + @
- p = getPointcut("@this(@Foo)");
+ p = getPointcut("@this(Foo)");
matches = p.couldMatchKinds();
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
@@ -315,7 +315,7 @@ public class PointcutRewriterTest extends TestCase {
}
}
// + @
- p = getPointcut("@target(@Foo)");
+ p = getPointcut("@target(Foo)");
matches = p.couldMatchKinds();
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
@@ -337,7 +337,7 @@ public class PointcutRewriterTest extends TestCase {
}
public void testKindSetOfAnnotation() {
- Pointcut p = getPointcut("@annotation(@Foo)");
+ Pointcut p = getPointcut("@annotation(Foo)");
assertTrue("All kinds",p.couldMatchKinds().containsAll(Shadow.ALL_SHADOW_KINDS));
}
@@ -345,7 +345,7 @@ public class PointcutRewriterTest extends TestCase {
Pointcut p = getPointcut("within(*)");
assertTrue("All kinds",p.couldMatchKinds().containsAll(Shadow.ALL_SHADOW_KINDS));
// + @
- p = getPointcut("@within(@Foo)");
+ p = getPointcut("@within(Foo)");
assertTrue("All kinds",p.couldMatchKinds().containsAll(Shadow.ALL_SHADOW_KINDS));
}
@@ -365,7 +365,7 @@ public class PointcutRewriterTest extends TestCase {
assertTrue("Need cons-exe for inlined field inits",matches.contains(Shadow.ConstructorExecution));
assertTrue("Need init for inlined field inits",matches.contains(Shadow.Initialization));
// + @
- p = getPointcut("@withincode(@Foo)");
+ p = getPointcut("@withincode(Foo)");
matches = p.couldMatchKinds();
for (Iterator iter = matches.iterator(); iter.hasNext();) {
Shadow.Kind kind = (Shadow.Kind) iter.next();
@@ -409,9 +409,9 @@ public class PointcutRewriterTest extends TestCase {
}
public void testOrderingInAnd() {
- Pointcut bigLongPC = getPointcut("cflow(this(Foo)) && @args(@X) && args(X) && @this(@Foo) && @target(@Boo) && this(Moo) && target(Boo) && @annotation(@Moo) && @withincode(@Boo) && withincode(new(..)) && set(* *)&& @within(@Foo) && within(Foo)");
+ Pointcut bigLongPC = getPointcut("cflow(this(Foo)) && @args(X) && args(X) && @this(Foo) && @target(Boo) && this(Moo) && target(Boo) && @annotation(Moo) && @withincode(Boo) && withincode(new(..)) && set(* *)&& @within(Foo) && within(Foo)");
Pointcut rewritten = prw.rewrite(bigLongPC);
- assertEquals("((((((((((((within(Foo) && @within(@Foo)) && set(* *)) && withincode(new(..))) && @withincode(@Boo)) && @annotation(@Moo)) && target(Boo)) && this(Moo)) && @target(@Boo)) && @this(@Foo)) && args(X)) && @args(@X)) && cflow(this(Foo)))",rewritten.toString());
+ assertEquals("((((((((((((within(Foo) && @within(Foo)) && set(* *)) && withincode(new(..))) && @withincode(Boo)) && @annotation(Moo)) && target(Boo)) && this(Moo)) && @target(Boo)) && @this(Foo)) && args(X)) && @args(X)) && cflow(this(Foo)))",rewritten.toString());
}
public void testOrderingInSimpleOr() {