]> source.dussan.org Git - aspectj.git/commitdiff
first @annotation test
authoracolyer <acolyer>
Wed, 8 Dec 2004 16:27:58 +0000 (16:27 +0000)
committeracolyer <acolyer>
Wed, 8 Dec 2004 16:27:58 +0000 (16:27 +0000)
tests/java5/annotations/AnnotationAspect03.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java

diff --git a/tests/java5/annotations/AnnotationAspect03.aj b/tests/java5/annotations/AnnotationAspect03.aj
new file mode 100644 (file)
index 0000000..04399e1
--- /dev/null
@@ -0,0 +1,7 @@
+public aspect AnnotationAspect03 {
+    
+    declare warning : execution(* *.*(..)) && @annotation(@SimpleAnnotation)
+                    : "@annotation matched here";
+    
+    
+}
\ No newline at end of file
index 58b41528e371019a067c6044ac28b00df44a8dad..6662c08c2e5053adf851454ebb9332f925f4de94 100644 (file)
@@ -11,6 +11,8 @@
 package org.aspectj.systemtest.ajc150;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.aspectj.bridge.IMessage;
 import org.aspectj.tools.ajc.CompilationResult;
@@ -51,4 +53,11 @@ public class AnnotationPointcuts extends TestUtils {
 //                     msg3_field.toString().indexOf("can't make inter-type field declarations")!=-1);
 //     verifyWeavingMessagesOutput(cR,new String[]{});
   }
+  
+  public void test002_AtAnnotationMatching() {
+      CompilationResult cR = binaryWeave("testcode.jar","AnnotationAspect03.aj",0,1);
+      List expectedWarnings = new ArrayList();
+      expectedWarnings.add(new Message("@annotation matched here"));  // L 8
+      assertMessages(cR, new MessageSpec(expectedWarnings, new ArrayList()));
+  }
 }
\ No newline at end of file