From: aclement Date: Mon, 28 Nov 2005 13:18:57 +0000 (+0000) Subject: pr93310 now fixed ! X-Git-Tag: V1_5_0RC1~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=340f99477cb028f696760f54ebaaf91f840d9eca;p=aspectj.git pr93310 now fixed ! --- diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index f7a1ef17e..e98f0aad5 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -703,17 +703,24 @@ public class AjdeInteractionTestbed extends TestCase { public static boolean informedAboutKindOfBuild; public static boolean fullBuildOccurred; + public static List detectedDeletions = new ArrayList(); public static void reset() { informedAboutKindOfBuild=false; fullBuildOccurred=false; + if (detectedDeletions!=null) detectedDeletions.clear(); } public boolean pathChange = false; public void pathChangeDetected() {pathChange = true;} public void aboutToCompareClasspaths(List oldClasspath, List newClasspath) {} public void detectedClassChangeInThisDir(File f) {} + + public void detectedAspectDeleted(File f) { + detectedDeletions.add(f.toString()); + } + public void buildSuccessful(boolean wasFullBuild) { informedAboutKindOfBuild= true; fullBuildOccurred=wasFullBuild; diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index df3255e7d..15fa9192e 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -321,29 +321,36 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed { } */ -// public void testPr93310_1() { -// AjdeInteractionTestbed.VERBOSE = true; -// initialiseProject("PR93310_1"); -// build("PR93310_1"); -// checkWasFullBuild(); -// String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR93310_1" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "C2.java"; -// (new File(fileC2)).delete(); -// alter("PR93310_1","inc1"); -// build("PR93310_1"); -// checkWasntFullBuild(); -// } - -// public void testPr93310_2() { -// AjdeInteractionTestbed.VERBOSE = true; -// initialiseProject("PR93310_2"); -// build("PR93310_2"); -// checkWasFullBuild(); -// String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR93310_2" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "C2.java"; -// (new File(fileC2)).delete(); -// alter("PR93310_2","inc1"); -// build("PR93310_2"); -// checkWasntFullBuild(); -// } + public void testPr93310_1() { + initialiseProject("PR93310_1"); + build("PR93310_1"); + checkWasFullBuild(); + String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR93310_1" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "C2.java"; + (new File(fileC2)).delete(); + alter("PR93310_1","inc1"); + build("PR93310_1"); + checkWasFullBuild(); + int l = AjdeInteractionTestbed.MyStateListener.detectedDeletions.size(); + assertTrue("Expected one deleted file to be noticed, but detected: "+l,l==1); + String name = (String)AjdeInteractionTestbed.MyStateListener.detectedDeletions.get(0); + assertTrue("Should end with C2.java but is "+name,name.endsWith("C2.java")); + } + + public void testPr93310_2() { + initialiseProject("PR93310_2"); + build("PR93310_2"); + checkWasFullBuild(); + String fileC2 = getWorkingDir().getAbsolutePath() + File.separatorChar + "PR93310_2" + File.separatorChar + "src" + File.separatorChar + "pack" + File.separatorChar + "C2.java"; + (new File(fileC2)).delete(); + alter("PR93310_2","inc1"); + build("PR93310_2"); + checkWasFullBuild(); + int l = AjdeInteractionTestbed.MyStateListener.detectedDeletions.size(); + assertTrue("Expected one deleted file to be noticed, but detected: "+l,l==1); + String name = (String)AjdeInteractionTestbed.MyStateListener.detectedDeletions.get(0); + assertTrue("Should end with C2.java but is "+name,name.endsWith("C2.java")); + } + // 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 !