From: aclement Date: Fri, 11 Nov 2005 18:24:14 +0000 (+0000) Subject: fix for pr113531 X-Git-Tag: V1_5_0RC1~197 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=efbf62be5e5732e14a05a8bbe509289c8f6167d0;p=aspectj.git fix for pr113531 --- diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index acb91bddb..7cb951e1a 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -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: