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;
/**
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: