From d279a507f5633f03f307eb8e6ace52a7a5df4d17 Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 10 Dec 2004 13:25:46 +0000 Subject: [PATCH] test correct detection of @args in a declare --- tests/java5/annotations/args/DeclareEoW.java | 5 +++++ .../systemtest/ajc150/AnnotationRuntimeTests.java | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/java5/annotations/args/DeclareEoW.java 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(); -- 2.39.5