]> source.dussan.org Git - aspectj.git/commitdiff
pr93310 now fixed !
authoraclement <aclement>
Mon, 28 Nov 2005 13:18:57 +0000 (13:18 +0000)
committeraclement <aclement>
Mon, 28 Nov 2005 13:18:57 +0000 (13:18 +0000)
tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index f7a1ef17ea9768745f31630c64ee020afc85417a..e98f0aad550f0261344e010662436d2598a8109d 100644 (file)
@@ -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;
index df3255e7d2586e4385f4cb916df0ec24f9c8a053..15fa9192e51df7e78d73dfd5038606a878c48cc4 100644 (file)
@@ -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 !