From: acolyer Date: Wed, 8 Dec 2004 16:27:58 +0000 (+0000) Subject: first @annotation test X-Git-Tag: Root_AspectJ5_Development~177 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=29ff1d8b622942ebae950e856ea4923fb03ba8c1;p=aspectj.git first @annotation test --- 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