]> source.dussan.org Git - aspectj.git/commitdiff
test for pr113531. test patch is from Helen. Currently commented out in MultiProject...
authoraclement <aclement>
Mon, 7 Nov 2005 11:22:49 +0000 (11:22 +0000)
committeraclement <aclement>
Mon, 7 Nov 2005 11:22:49 +0000 (11:22 +0000)
tests/multiIncremental/PR113531/base/src/pack1/A.aj [new file with mode: 0644]
tests/multiIncremental/PR113531/base/src/pack1/A1.aj [new file with mode: 0644]
tests/multiIncremental/PR113531/inc1/src/pack1/A.aj [new file with mode: 0644]
tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj [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/PR113531/base/src/pack1/A.aj b/tests/multiIncremental/PR113531/base/src/pack1/A.aj
new file mode 100644 (file)
index 0000000..489fa4d
--- /dev/null
@@ -0,0 +1,7 @@
+package pack1;
+
+public abstract aspect A {
+
+       protected int foo;
+       
+}
diff --git a/tests/multiIncremental/PR113531/base/src/pack1/A1.aj b/tests/multiIncremental/PR113531/base/src/pack1/A1.aj
new file mode 100644 (file)
index 0000000..864dda1
--- /dev/null
@@ -0,0 +1,9 @@
+package pack1;
+
+public aspect A1 extends A {
+       
+       private void bar () {
+               foo = 2;
+       }
+       
+}
diff --git a/tests/multiIncremental/PR113531/inc1/src/pack1/A.aj b/tests/multiIncremental/PR113531/inc1/src/pack1/A.aj
new file mode 100644 (file)
index 0000000..7e8543d
--- /dev/null
@@ -0,0 +1,7 @@
+package pack1;
+
+public abstract aspect A {
+
+       private int foo;
+       
+}
diff --git a/tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj b/tests/multiIncremental/PR113531/inc2/src/pack1/A3.aj
new file mode 100644 (file)
index 0000000..4e65eea
--- /dev/null
@@ -0,0 +1,5 @@
+package pack1;
+
+public aspect A3 {
+
+}
index 902028862668b880dc7ecb9b2d35f4a3732aa48b..146793f26aa4159f2f205203dd628580c8f12c4b 100644 (file)
@@ -267,6 +267,8 @@ public class AjdeInteractionTestbed extends TestCase {
        
        static class MyErrorHandler implements ErrorHandler {
                static MyErrorHandler _instance = new MyErrorHandler();
+               private List errorMessages = new ArrayList();
+               
                private MyErrorHandler() {}
                
                public static ErrorHandler getInstance() { 
@@ -279,12 +281,17 @@ public class AjdeInteractionTestbed extends TestCase {
 
                public void handleError(String message) {
                        log("ErrorHandler.handleWarning("+message+")");
-                       
+                       errorMessages.add(message);
                }
 
                public void handleError(String message, Throwable t) {
                        log("ErrorHandler.handleError("+message+","+t+")");
                        if (VERBOSE) t.printStackTrace();
+                       errorMessages.add(message+","+t+")");
+               }
+               
+               public static List/*String*/ getErrorMessages() {
+                       return _instance.errorMessages;
                }
                
        }
index 706410f4076707dec5406f37e2bed85247570a53..a5813ea10b1109dfbd4d311c8011ccd8a29bd4ab 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.ajdt.internal.core.builder.AjState;
 import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager;
 import org.aspectj.asm.AsmManager;
 import org.aspectj.asm.IProgramElement;
+import org.aspectj.bridge.IMessage;
 import org.aspectj.testing.util.FileUtil;
 
 /**
@@ -296,6 +297,23 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
                build("PR111779");
        }
 */
+       
+//     public void testPr113531() {
+//             initialiseProject("PR113531");
+//             build("PR113531");
+//             assertFalse("build should have compiled ok",
+//                             MyTaskListManager.hasErrorMessages());
+//             alter("PR113531","inc1");
+//             build("PR113531");
+//             assertEquals("error message should be 'foo cannot be resolved' ",
+//                             "foo cannot be resolved",
+//                             ((IMessage)MyTaskListManager.getErrorMessages().get(0))
+//                                     .getMessage());
+//             alter("PR113531","inc2");
+//             build("PR113531");
+//             assertTrue("There should be no exceptions handled",
+//                             MyErrorHandler.getErrorMessages().isEmpty());           
+//     }
 
        
        // other possible tests: