summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/java5/annotations/args/DeclareEoW.java5
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AnnotationRuntimeTests.java13
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/java5/annotations/args/DeclareEoW.java b/tests/java5/annotations/args/DeclareEoW.java
new file mode 100644
index 000000000..2c598e42f
--- /dev/null
+++ b/tests/java5/annotations/args/DeclareEoW.java
@@ -0,0 +1,5 @@
+public aspect DeclareEoW {
+
+ declare warning : @args(@MyAnnotation) : "@args is not allowed in declares...";
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AnnotationRuntimeTests.java b/tests/src/org/aspectj/systemtest/ajc150/AnnotationRuntimeTests.java
index 0d607b905..53b43299c 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AnnotationRuntimeTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AnnotationRuntimeTests.java
@@ -65,8 +65,17 @@ public class AnnotationRuntimeTests extends TestUtils {
// TODO need to RUN the result of these tests...
System.out.println(cR);
}
-
- public void test006_Within_Code() {
+
+ public void test006_CantUseinDecEoW() {
+ baseDir = new File("../tests/java5/annotations/args");
+ CompilationResult cR = binaryWeave("TestingArgsAnnotations.jar","DeclareEoW.java",2,0);
+ List errors = new ArrayList();
+ errors.add(new Message(3,"args() pointcut designator cannot be used in declare statement"));
+ MessageSpec messageSpec = new MessageSpec(new ArrayList(), errors);
+ assertMessages(cR, messageSpec);
+ }
+
+ public void test007_Within_Code() {
baseDir = new File("../tests/java5/annotations/within_code");
CompilationResult cR = binaryWeave("TestingAnnotations.jar","WithinAndWithinCodeTests.java",0,5);
List warnings = new ArrayList();