]> source.dussan.org Git - aspectj.git/commitdiff
tests for 117882
authoraclement <aclement>
Sun, 4 Dec 2005 13:31:33 +0000 (13:31 +0000)
committeraclement <aclement>
Sun, 4 Dec 2005 13:31:33 +0000 (13:31 +0000)
tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index cd8b51f09bf0d65e58079d45c586cc015f527952..30ee4e15ec1997717a1fbef580b595c1ad9bfeb4 100644 (file)
@@ -89,6 +89,10 @@ public class AjdeInteractionTestbed extends TestCase {
                return AjdeManager.build(projectName,configFile);
        }
 
+       public boolean fullBuild(String projectName,String configFile) {
+               return AjdeManager.fullBuild(projectName,configFile);
+       }
+       
        /** Looks after communicating with the singleton Ajde instance */
        public static class AjdeManager {
                
@@ -152,6 +156,48 @@ public class AjdeInteractionTestbed extends TestCase {
                        return true;
                }
                
+               private static boolean fullBuild(String projectName,String configFile) {
+                       pause(1000); // delay to allow previous runs build stamps to be OK
+                       lognoln("Building project '"+projectName+"'");
+                       
+                       // Ajde.getDefault().enableLogging(System.out);
+                       
+                       //Ajde.getDefault().getBuildManager().setReportInfoMessages(true); 
+                       
+                       // Configure the necessary providers and listeners for this compile
+                       MyBuildProgressMonitor.reset();
+                       MyTaskListManager.reset();
+                       MyStateListener.reset();
+                       
+                       MyProjectPropertiesAdapter.setActiveProject(projectName);
+                       //AsmManager.attemptIncrementalModelRepairs=true;
+                       //IncrementalStateManager.recordIncrementalStates=true;
+                       
+                       Ajde.getDefault().getBuildManager().setBuildModelMode(buildModel);
+                       
+                       // Do the compile
+                       Ajde.getDefault().getBuildManager().buildFresh(getFile(projectName,configFile));
+                       
+                       // Wait for it to complete
+                       while (!MyBuildProgressMonitor.hasFinished()) {
+                               lognoln(".");
+                               pause(100);
+                       } 
+                       log("");
+                   
+                       // What happened?
+                       if (MyTaskListManager.hasErrorMessages()) {
+                               System.err.println("Build errors:");
+                               for (Iterator iter = MyTaskListManager.getErrorMessages().iterator(); iter.hasNext();) {
+                                       IMessage element = (IMessage) iter.next();
+                                       System.err.println(element);
+                               }
+                               System.err.println("---------");
+                       }
+                       log("Build finished, time taken = "+MyBuildProgressMonitor.getTimeTaken()+"ms");
+                       return true;
+               }
+               
                private static void pause(int millis) {
                        try {
                                Thread.sleep(millis);
@@ -640,7 +686,10 @@ public class AjdeInteractionTestbed extends TestCase {
                }
 
                public Map getJavaOptionsMap() {
-                       return null;
+                       Hashtable ht = new Hashtable();
+                       ht.put("org.eclipse.jdt.core.compiler.compliance","1.5");
+                       ht.put("org.eclipse.jdt.core.compiler.codegen.targetPlatform","1.5");
+                       return ht;
                }
 
                public boolean getUseJavacMode() {
index c35efcdc49b3f979f7b79e8049b3d84e31ccdf09..c764666de42f83b004d2c2e6c5ac0036e51954db 100644 (file)
@@ -313,6 +313,35 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
                checkWasntFullBuild();
        }
        
+       public void testPr117882() {
+//             AjdeInteractionTestbed.VERBOSE=true;
+//             AjdeInteractionTestbed.configureBuildStructureModel(true);
+               initialiseProject("PR117882");
+               build("PR117882");
+               checkWasFullBuild();
+               alter("PR117882","inc1");
+               build("PR117882");
+               checkWasntFullBuild();
+//             AjdeInteractionTestbed.VERBOSE=false;
+//             AjdeInteractionTestbed.configureBuildStructureModel(false);
+       }
+       
+       public void testPr117882_2() {
+//             AjdeInteractionTestbed.VERBOSE=true;
+//             AjdeInteractionTestbed.configureBuildStructureModel(true);
+               initialiseProject("PR117882_2");
+               build("PR117882_2");
+               checkWasFullBuild();
+               alter("PR117882_2","inc1");
+               build("PR117882_2");
+               checkWasntFullBuild();
+               checkCompileWeaveCount(1,4);
+               //fullBuild("PR117882_2");
+               //checkWasFullBuild();
+//             AjdeInteractionTestbed.VERBOSE=false;
+//             AjdeInteractionTestbed.configureBuildStructureModel(false);
+       }
+       
        public void testPr115251() {
                //AjdeInteractionTestbed.VERBOSE=true;
                initialiseProject("PR115251");
@@ -454,7 +483,11 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
                if (AjdeInteractionTestbed.VERBOSE) printBuildReport();
        }
        
-       
+       public void fullBuild(String projectName) {
+               constructUpToDateLstFile(projectName,"build.lst");
+               fullBuild(projectName,"build.lst");
+               if (AjdeInteractionTestbed.VERBOSE) printBuildReport();
+       }
 
        private void constructUpToDateLstFile(String pname,String configname) {
                File projectBase = new File(sandboxDir,pname);