]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 128655
authoraclement <aclement>
Tue, 21 Feb 2006 09:25:09 +0000 (09:25 +0000)
committeraclement <aclement>
Tue, 21 Feb 2006 09:25:09 +0000 (09:25 +0000)
13 files changed:
tests/multiIncremental/pr128655/A.java [new file with mode: 0644]
tests/multiIncremental/pr128655/Foo.java [new file with mode: 0644]
tests/multiIncremental/pr128655/T.java [new file with mode: 0644]
tests/multiIncremental/pr128655/base/A.java [new file with mode: 0644]
tests/multiIncremental/pr128655/base/Foo.java [new file with mode: 0644]
tests/multiIncremental/pr128655/base/T.java [new file with mode: 0644]
tests/multiIncremental/pr128655/inc1/T.java [new file with mode: 0644]
tests/multiIncremental/pr128655_2/base/A.java [new file with mode: 0644]
tests/multiIncremental/pr128655_2/base/Foo.java [new file with mode: 0644]
tests/multiIncremental/pr128655_2/base/T.java [new file with mode: 0644]
tests/multiIncremental/pr128655_2/inc1/T.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/pr128655/A.java b/tests/multiIncremental/pr128655/A.java
new file mode 100644 (file)
index 0000000..e1728b7
--- /dev/null
@@ -0,0 +1,5 @@
+
+
+public aspect A {
+  declare @type: T: @Foo;
+}
diff --git a/tests/multiIncremental/pr128655/Foo.java b/tests/multiIncremental/pr128655/Foo.java
new file mode 100644 (file)
index 0000000..bf1c2ce
--- /dev/null
@@ -0,0 +1,6 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Foo {
+
+}
diff --git a/tests/multiIncremental/pr128655/T.java b/tests/multiIncremental/pr128655/T.java
new file mode 100644 (file)
index 0000000..9f5e91e
--- /dev/null
@@ -0,0 +1,4 @@
+
+public class T {
+  
+}
diff --git a/tests/multiIncremental/pr128655/base/A.java b/tests/multiIncremental/pr128655/base/A.java
new file mode 100644 (file)
index 0000000..3fe24bf
--- /dev/null
@@ -0,0 +1,4 @@
+
+public aspect A {
+  declare @type: T: @a.b.c.Foo;
+}
diff --git a/tests/multiIncremental/pr128655/base/Foo.java b/tests/multiIncremental/pr128655/base/Foo.java
new file mode 100644 (file)
index 0000000..3e46852
--- /dev/null
@@ -0,0 +1,7 @@
+package a.b.c;
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Foo {
+
+}
diff --git a/tests/multiIncremental/pr128655/base/T.java b/tests/multiIncremental/pr128655/base/T.java
new file mode 100644 (file)
index 0000000..9f5e91e
--- /dev/null
@@ -0,0 +1,4 @@
+
+public class T {
+  
+}
diff --git a/tests/multiIncremental/pr128655/inc1/T.java b/tests/multiIncremental/pr128655/inc1/T.java
new file mode 100644 (file)
index 0000000..9f5e91e
--- /dev/null
@@ -0,0 +1,4 @@
+
+public class T {
+  
+}
diff --git a/tests/multiIncremental/pr128655_2/base/A.java b/tests/multiIncremental/pr128655_2/base/A.java
new file mode 100644 (file)
index 0000000..90c4b4d
--- /dev/null
@@ -0,0 +1,4 @@
+
+public aspect A {
+  declare @type: T: @Foo;
+}
diff --git a/tests/multiIncremental/pr128655_2/base/Foo.java b/tests/multiIncremental/pr128655_2/base/Foo.java
new file mode 100644 (file)
index 0000000..bf1c2ce
--- /dev/null
@@ -0,0 +1,6 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Foo {
+
+}
diff --git a/tests/multiIncremental/pr128655_2/base/T.java b/tests/multiIncremental/pr128655_2/base/T.java
new file mode 100644 (file)
index 0000000..9f5e91e
--- /dev/null
@@ -0,0 +1,4 @@
+
+public class T {
+  
+}
diff --git a/tests/multiIncremental/pr128655_2/inc1/T.java b/tests/multiIncremental/pr128655_2/inc1/T.java
new file mode 100644 (file)
index 0000000..9f5e91e
--- /dev/null
@@ -0,0 +1,4 @@
+
+public class T {
+  
+}
index 3af1d2fb290cb25b6ec185cf206d9bd47ac678a6..e8f0e4d08c8047bc406e715042a023f9189b6372 100644 (file)
@@ -626,12 +626,14 @@ public class AjdeInteractionTestbed extends TestCase {
                private boolean receivedBatchBuildMessage = false;
                private List errorMessages = new ArrayList();
                private List warningMessages = new ArrayList();
+               private List weavingMessages = new ArrayList();
                
                public static void reset() {
                        _instance.receivedNonIncrementalBuildMessage=false;
                        _instance.receivedBatchBuildMessage=false;
                        _instance.errorMessages.clear();
                        _instance.warningMessages.clear();
+                       _instance.weavingMessages.clear();
                }
                
 //             public static boolean defaultedToBatch() {
@@ -654,6 +656,10 @@ public class AjdeInteractionTestbed extends TestCase {
                        return _instance.warningMessages;
                }
                
+               public static List/*IMessage*/ getWeavingMessages() {
+                       return _instance.weavingMessages;
+               }
+               
                public static TaskListManager getInstance() { 
                        return _instance;
                }
@@ -668,12 +674,9 @@ public class AjdeInteractionTestbed extends TestCase {
 //                             if (message.getMessage().startsWith(CANT_BUILD_INCREMENTAL_INDICATION)) _instance.receivedNonIncrementalBuildMessage=true;
 //                             if (message.getMessage().startsWith(DOING_BATCH_BUILD_INDICATION)) _instance.receivedBatchBuildMessage=true;
 //                     }
-                       if (message.getKind()==IMessage.ERROR) {
-                               errorMessages.add(message);
-                       }
-                       if (message.getKind()==IMessage.WARNING) {
-                               warningMessages.add(message);
-                       }
+                       if (message.getKind()==IMessage.ERROR) errorMessages.add(message);
+                       if (message.getKind()==IMessage.WARNING) warningMessages.add(message);
+                       if (message.getKind()==IMessage.WEAVEINFO) weavingMessages.add(message);
                        log("TaskListManager.addSourcelineTask("+message+")");
                }
 
index 0623ee58ac4ff47d0ac17a720c031f7b32717745..7a13abed55272c34e7740a0a7da9825cdbe3d784 100644 (file)
@@ -515,7 +515,7 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
        }
        
        public void testPr112736() {
-               AjdeInteractionTestbed.VERBOSE = true;
+       //      AjdeInteractionTestbed.VERBOSE = true;
                initialiseProject("PR112736");
                build("PR112736");
                checkWasFullBuild();
@@ -547,6 +547,52 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
                checkWasFullBuild(); // back to the source
        }
        
+
+       public void testPr128655() {
+               configureNonStandardCompileOptions("-showWeaveInfo");
+               initialiseProject("pr128655");
+               build("pr128655");
+               List firstBuildMessages = MyTaskListManager.getWeavingMessages();
+               assertTrue("Should be at least one message about the dec @type, but there were none",firstBuildMessages.size()>0);
+               alter("pr128655","inc1");
+               build("pr128655");
+               checkWasntFullBuild(); // back to the source
+               List secondBuildMessages = MyTaskListManager.getWeavingMessages();
+               // check they are the same
+               for (int i = 0; i < firstBuildMessages.size(); i++) {
+                       IMessage m1 = (IMessage)firstBuildMessages.get(i);
+                       IMessage m2 = (IMessage)secondBuildMessages.get(i);
+                       if (!m1.toString().equals(m2.toString())) {
+                               System.err.println("Message during first build was: "+m1);
+                               System.err.println("Message during second build was: "+m1);
+                               fail("The two messages should be the same, but are not: \n"+m1+"!="+m2);
+                       }
+               }
+       }
+       
+       // Similar to above, but now the annotation is in the default package
+       public void testPr128655_2() {
+               configureNonStandardCompileOptions("-showWeaveInfo");
+               initialiseProject("pr128655_2");
+               build("pr128655_2");
+               List firstBuildMessages = MyTaskListManager.getWeavingMessages();
+               assertTrue("Should be at least one message about the dec @type, but there were none",firstBuildMessages.size()>0);
+               alter("pr128655_2","inc1");
+               build("pr128655_2");
+               checkWasntFullBuild(); // back to the source
+               List secondBuildMessages = MyTaskListManager.getWeavingMessages();
+               // check they are the same
+               for (int i = 0; i < firstBuildMessages.size(); i++) {
+                       IMessage m1 = (IMessage)firstBuildMessages.get(i);
+                       IMessage m2 = (IMessage)secondBuildMessages.get(i);
+                       if (!m1.toString().equals(m2.toString())) {
+                               System.err.println("Message during first build was: "+m1);
+                               System.err.println("Message during second build was: "+m1);
+                               fail("The two messages should be the same, but are not: \n"+m1+"!="+m2);
+                       }
+               }
+       }
+       
        // other possible tests:
        // - memory usage (freemem calls?)
        // - relationship map