From 35409d862033981f275c9150f97023de411c1048 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 28 Apr 2011 19:59:35 +0000 Subject: [PATCH] 328121 --- .../TestRequirements/TestRequirements.java | 33 +++++++++++++++++++ .../tools/MultiProjectIncrementalTests.java | 11 +++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/multiIncremental/pr328121/base/src/TestRequirements/TestRequirements.java diff --git a/tests/multiIncremental/pr328121/base/src/TestRequirements/TestRequirements.java b/tests/multiIncremental/pr328121/base/src/TestRequirements/TestRequirements.java new file mode 100644 index 000000000..3d4c29f18 --- /dev/null +++ b/tests/multiIncremental/pr328121/base/src/TestRequirements/TestRequirements.java @@ -0,0 +1,33 @@ +package TestRequirements; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + + +@Retention(RetentionPolicy.RUNTIME) +@interface AnnotatedMethod {} + +@Retention(RetentionPolicy.RUNTIME) +@interface NewAnnotatedMethod { + boolean newValue(); +} + +aspect X { + declare @method: !@AnnotatedMethod * TestRequirements.*(..) : @NewAnnotatedMethod(newValue = true); +} + +public class TestRequirements { + @AnnotatedMethod + public void dontMatchMe() {} + + public void matchMe() {} + + public static void foo() throws Exception { + if (TestRequirements.class.getDeclaredMethod("dontMatchMe").getAnnotation(NewAnnotatedMethod.class)!=null) { + throw new IllegalStateException(); + } + if (TestRequirements.class.getDeclaredMethod("matchMe").getAnnotation(NewAnnotatedMethod.class)==null) { + throw new IllegalStateException(); + } + } +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 5408f7ae2..71d5d876f 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -67,6 +67,17 @@ import org.aspectj.weaver.World; */ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementalAjdeInteractionTestbed { + public void testMissingRel_328121() throws Exception { + String p = "pr328121"; + initialiseProject(p); + build(p); + checkWasFullBuild(); + assertNoErrors(p); + // Check the annotations: + runMethod(p,"TestRequirements.TestRequirements","foo"); + assertEquals(4,getRelationshipCount(p)); + } + public void testEncoding_pr290741() throws Exception { String p = "pr290741"; initialiseProject(p); -- 2.39.5