summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-12-08 16:27:58 +0000
committeracolyer <acolyer>2004-12-08 16:27:58 +0000
commit29ff1d8b622942ebae950e856ea4923fb03ba8c1 (patch)
tree93ff24c3e3abfaad3acc5255f84c949f587102d0 /tests
parentd5bc7f7caac0cde68010baa5c2f73de8b7ccc410 (diff)
downloadaspectj-29ff1d8b622942ebae950e856ea4923fb03ba8c1.tar.gz
aspectj-29ff1d8b622942ebae950e856ea4923fb03ba8c1.zip
first @annotation test
Diffstat (limited to 'tests')
-rw-r--r--tests/java5/annotations/AnnotationAspect03.aj7
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java9
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/java5/annotations/AnnotationAspect03.aj b/tests/java5/annotations/AnnotationAspect03.aj
new file mode 100644
index 000000000..04399e188
--- /dev/null
+++ b/tests/java5/annotations/AnnotationAspect03.aj
@@ -0,0 +1,7 @@
+public aspect AnnotationAspect03 {
+
+ declare warning : execution(* *.*(..)) && @annotation(@SimpleAnnotation)
+ : "@annotation matched here";
+
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java b/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java
index 58b41528e..6662c08c2 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AnnotationPointcuts.java
@@ -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