]> source.dussan.org Git - aspectj.git/commitdiff
288635: cce munger
authoraclement <aclement>
Fri, 4 Sep 2009 17:39:50 +0000 (17:39 +0000)
committeraclement <aclement>
Fri, 4 Sep 2009 17:39:50 +0000 (17:39 +0000)
tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj [new file with mode: 0644]
tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj [new file with mode: 0644]
tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj [new file with mode: 0644]
tests/bugs166/pr288635/org/tests/atann/TestClass.java [new file with mode: 0644]
tests/bugs166/pr288635/org/tests/atann/Traced.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc166/Ajc166Tests.java
tests/src/org/aspectj/systemtest/ajc166/ajc166.xml

diff --git a/tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj b/tests/bugs166/pr288635/org/tests/atann/AddAnnotations.aj
new file mode 100644 (file)
index 0000000..a43a6d7
--- /dev/null
@@ -0,0 +1,7 @@
+package org.tests.atann;
+
+public aspect AddAnnotations {
+       
+       declare @method : public int *do*(..) : @Traced;
+
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj b/tests/bugs166/pr288635/org/tests/atann/AddITDDoMethod.aj
new file mode 100644 (file)
index 0000000..7202a15
--- /dev/null
@@ -0,0 +1,9 @@
+package org.tests.atann;
+
+public aspect AddITDDoMethod {
+
+       public int TestClass.doAnother() {
+               return 2;
+       }
+       
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj b/tests/bugs166/pr288635/org/tests/atann/InterceptTraceds.aj
new file mode 100644 (file)
index 0000000..77eed52
--- /dev/null
@@ -0,0 +1,13 @@
+package org.tests.atann;
+
+public aspect InterceptTraceds {
+
+       before(Traced t) : execution(@Traced * *.*(..)) && @annotation(t) {
+               if (t != null) {
+                       System.out.println("Executing " + thisJoinPoint + " on level " + t.level());
+               } else {
+                       System.out.println("Annotation was null on " + thisJoinPoint);
+               }
+       }
+       
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/TestClass.java b/tests/bugs166/pr288635/org/tests/atann/TestClass.java
new file mode 100644 (file)
index 0000000..f7265f7
--- /dev/null
@@ -0,0 +1,21 @@
+package org.tests.atann;
+
+public class TestClass {
+
+       @Traced
+       public String doAnnotated() {
+               return "annotated";
+       }
+       
+       public int doITDAnnotation() {
+               return 1;
+       }
+       
+       public static void main(String[] args) {
+               TestClass tc = new TestClass();
+               tc.doAnnotated();
+               tc.doITDAnnotation();
+               tc.doAnother();
+       }
+       
+}
diff --git a/tests/bugs166/pr288635/org/tests/atann/Traced.java b/tests/bugs166/pr288635/org/tests/atann/Traced.java
new file mode 100644 (file)
index 0000000..77fd94a
--- /dev/null
@@ -0,0 +1,14 @@
+package org.tests.atann;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface Traced {
+       
+       String level() default "debug";
+
+}
index 901ea840b71f6f380252586ea9ee604294f2493e..62355aa4bb2867510ddf38fd2d98949b9539578e 100644 (file)
@@ -18,6 +18,22 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc166Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testMungerCCE_288635() {
+               runTest("munger cce");
+       }
+
+       // public void testNPEonBadAspectDecl_286375() {
+       // runTest("npe on bad aspect decl");
+       // }
+       //
+       // public void testAnnoModifierOrdering_287597_1() {
+       // runTest("anno modifier ordering - 1");
+       // }
+       //
+       // public void testDeclareAnnoCompoundExpression_287613() {
+       // runTest("dec anno compound expressions");
+       // }
+
        public void testHasMember_284862() {
                runTest("npe hasmember");
        }
index 2ff98c6abf1d7ba3e850588654eb6b0e2d0eb6fc..bb873164e379daa7280a55f1e9d1f3829cc3e14a 100644 (file)
@@ -1,7 +1,28 @@
 <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
 
 <suite>
+
+  <ajc-test dir="bugs166/pr288635" title="munger cce">
+     <compile files="org/tests/atann/AddAnnotations.aj org/tests/atann/AddITDDoMethod.aj org/tests/atann/InterceptTraceds.aj org/tests/atann/TestClass.java org/tests/atann/Traced.java" options="-1.5"/>
+     <run class="org.tests.atann.TestClass"/>
+  </ajc-test>
+  
    
+  <ajc-test dir="bugs166/pr286375" title="npe on bad aspect decl">
+     <compile files="DatabaseOperationMonitor.java" options="-1.5" outjar="wibble.jar"/>
+     <compile files="" inpath="wibble.jar" options="-1.5"/>
+  </ajc-test>
+  
+  <ajc-test dir="bugs166/pr287597" title="anno modifier ordering - 1">
+     <compile files="A.java" options="-1.5 -showWeaveInfo">
+       <message kind="weave" text="foo"/>
+     </compile>
+  </ajc-test>
+  
+  <ajc-test dir="bugs166/pr287613" title="dec anno compound expressions">
+     <compile files="DeclareAnnot.java" options="-1.5"/>
+  </ajc-test>
+  
   <ajc-test dir="bugs166/pr284862" title="npe hasmember">
      <compile files="InterfaceToAdd.java AnnotatedMethodImpl.aj AspectToMatch.aj AnnotatedMethodInterface.java Entity.java EntityClass.java PresentAnnotation.java SearchAnnotation.java" options="-1.5 -XhasMember"/>
   </ajc-test>