From ff57abb3598f3922370eabfbe08a6bc8655bf6b9 Mon Sep 17 00:00:00 2001 From: aclement Date: Sun, 4 Dec 2005 13:31:33 +0000 Subject: [PATCH] tests for 117882 --- .../tools/AjdeInteractionTestbed.java | 51 ++++++++++++++++++- .../tools/MultiProjectIncrementalTests.java | 35 ++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index cd8b51f09..30ee4e15e 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -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() { diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index c35efcdc4..c764666de 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -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); -- 2.39.5