]> source.dussan.org Git - aspectj.git/commitdiff
fix for pr113531
authoraclement <aclement>
Fri, 11 Nov 2005 18:24:14 +0000 (18:24 +0000)
committeraclement <aclement>
Fri, 11 Nov 2005 18:24:14 +0000 (18:24 +0000)
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index acb91bddb6f3df65b31a9524a95d1b822cc502f6..7cb951e1ae441d1b115c6381e4ac8625f65f9281 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,23 +297,29 @@ 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());           
-//     }
+       // Stage1: Compile two files, pack.A and pack.A1 - A1 sets a protected field in A. 
+       // Stage2: make the field private in class A > gives compile error
+       // Stage3: Add a new aspect whilst there is a compile error !
+       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:\n"+MyErrorHandler.getErrorMessages(),
+                               MyErrorHandler.getErrorMessages().isEmpty());           
+               assertEquals("error message should be 'foo cannot be resolved' ",
+                               "foo cannot be resolved",
+                               ((IMessage)MyTaskListManager.getErrorMessages().get(0))
+                                       .getMessage());
+       }
 
        
        // other possible tests: