]> source.dussan.org Git - aspectj.git/commitdiff
298504: test and fix: incremental build when invalid declare @type
authoraclement <aclement>
Mon, 15 Mar 2010 21:04:41 +0000 (21:04 +0000)
committeraclement <aclement>
Mon, 15 Mar 2010 21:04:41 +0000 (21:04 +0000)
tests/multiIncremental/pr298504/base/src/Asp.java [new file with mode: 0644]
tests/multiIncremental/pr298504/base/src/C.java [new file with mode: 0644]
tests/multiIncremental/pr298504/inc1/src/Asp.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/pr298504/base/src/Asp.java b/tests/multiIncremental/pr298504/base/src/Asp.java
new file mode 100644 (file)
index 0000000..c2ad124
--- /dev/null
@@ -0,0 +1,3 @@
+aspect Asp {
+  declare @type: C: @ManagedResource;
+}
diff --git a/tests/multiIncremental/pr298504/base/src/C.java b/tests/multiIncremental/pr298504/base/src/C.java
new file mode 100644 (file)
index 0000000..d405396
--- /dev/null
@@ -0,0 +1,2 @@
+public class C {
+}
diff --git a/tests/multiIncremental/pr298504/inc1/src/Asp.java b/tests/multiIncremental/pr298504/inc1/src/Asp.java
new file mode 100644 (file)
index 0000000..c2ad124
--- /dev/null
@@ -0,0 +1,3 @@
+aspect Asp {
+  declare @type: C: @ManagedResource;
+}
index b0b82e6f551ea306d4b3391527972c54ef24b806..cd81d05fc27741c8ec0769cb6780be8404a52348 100644 (file)
@@ -836,6 +836,23 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                assertEquals("Unexpected compiler error", 0, l.size());
        }
 
+       public void testDeclareAnnotationNPE_298504() {
+               AjdeInteractionTestbed.VERBOSE = true;
+               String p = "pr298504";
+               initialiseProject(p);
+               build(p);
+               List l = getErrorMessages(p);
+               assertTrue(l.toString().indexOf("ManagedResource cannot be resolved to a type") != -1);
+               // checkWasFullBuild();
+               alter(p, "inc1");
+               build(p);
+               // checkWasntFullBuild();
+               l = getCompilerErrorMessages(p);
+               assertTrue(l.toString().indexOf("NullPointerException") == -1);
+               l = getErrorMessages(p);
+               assertTrue(l.toString().indexOf("ManagedResource cannot be resolved to a type") != -1);
+       }
+
        public void testIncrementalAnnoStyle_pr286341() {
                AjdeInteractionTestbed.VERBOSE = true;
                String base = "pr286341_base";