]> source.dussan.org Git - aspectj.git/commitdiff
pr202088: test and fix for coping with abstract annotation pointcuts with context
authoraclement <aclement>
Wed, 7 Nov 2007 11:03:17 +0000 (11:03 +0000)
committeraclement <aclement>
Wed, 7 Nov 2007 11:03:17 +0000 (11:03 +0000)
tests/bugs154/pr202088/Bug.java [new file with mode: 0644]
tests/bugs154/pr202088/Bug2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
tests/src/org/aspectj/systemtest/ajc154/ajc154.xml

diff --git a/tests/bugs154/pr202088/Bug.java b/tests/bugs154/pr202088/Bug.java
new file mode 100644 (file)
index 0000000..cc40774
--- /dev/null
@@ -0,0 +1,8 @@
+package tracing;
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public abstract class Bug {
+       @Pointcut
+       public abstract void traced(Object thiz);
+}
\ No newline at end of file
diff --git a/tests/bugs154/pr202088/Bug2.java b/tests/bugs154/pr202088/Bug2.java
new file mode 100644 (file)
index 0000000..6b2ccb3
--- /dev/null
@@ -0,0 +1,33 @@
+package tracing;
+import org.aspectj.lang.annotation.*;
+
+@Aspect abstract class Bug {
+       @Pointcut
+       public abstract void traced(Object thiz);
+       
+       @Before("traced(o) && execution(* m(..))")
+       public void b1(Object o) {
+               System.out.println("o is '"+o+"'");
+       }
+       
+}
+
+public @Aspect class Bug2 extends Bug {
+       @Pointcut("this(thiz)")
+       public void traced(Object thiz) {}
+       
+       public static void main(String []argv) {
+               C.main(argv);
+       }
+}
+
+class C {
+       public static void main(String []argv) {
+               new C().m();
+       }
+       public void m() {
+               
+       }
+       
+       public String toString() { return "instance of C";}
+}
\ No newline at end of file
index 0655e37b23752627cf9d64a0439e2a3534a9ab41..0ba9571f0cf3a38b040b9544d8c171bb8bf1c813 100644 (file)
@@ -45,6 +45,7 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //             runTest("new pointcut designators in a reference pointcut");
 //     }
 
+       public void testAbstractAnnotationStylePointcutWithContext_pr202088() { runTest("abstract annotation style pointcut with context");}
        public void testNoErrorForAtDecpInNormalClass_pr169428() { runTest( "no error for atDecp in normal class");}
 
        public void testJarsZipsNonStandardSuffix_pr186673() { runTest("jars and zips with non-standard suffix");}
index 364f5bfef0c47386921702e151582c4864cadcae..a7c831c34ba43e8a4237250fbec09a096c7b62ed 100644 (file)
@@ -2,7 +2,16 @@
 
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
-
+ <ajc-test dir="bugs154/pr202088" title="abstract annotation style pointcut with context">
+     <compile options="-1.5" files="Bug.java"/>
+     <compile options="-1.5" files="Bug2.java">
+     </compile>
+     <run class="tracing.Bug2">
+       <stdout>
+         <line text="o is 'instance of C'"/>
+       </stdout>
+     </run>
+   </ajc-test>
 
    <ajc-test dir="bugs154/pr169428" title="no error for atDecp in normal class">
      <compile options="-1.5" files="CorrectError.java">