public void buildSuccessful(boolean wasFullBuild) {}
};
MyStateListener sl = new MyStateListener();
- AjState.stateListener = sl;
- runTest("change source");
- nextIncrement(false);
- copyFileAndDoIncrementalBuild("changes/Main.20.java","src/app/Main.java");
- assertTrue("Did not expect a path change to be detected ",!sl.pathChange);
- run("app.Main");
+ try {
+ AjState.stateListener = sl;
+ runTest("change source");
+ nextIncrement(false);
+ copyFileAndDoIncrementalBuild("changes/Main.20.java","src/app/Main.java");
+ assertTrue("Did not expect a path change to be detected ",!sl.pathChange);
+ run("app.Main");
+ } finally {
+ AjState.stateListener=null;
+ }
}
public void test009() throws Exception {
protected void setUp() throws Exception {
super.setUp();
+ if (AjState.stateListener==null) AjState.stateListener=MyStateListener.getInstance();
MyStateListener.reset();
MyBuildProgressMonitor.reset();
MyTaskListManager.reset();
createEmptySandbox();
}
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ AjState.stateListener=null;
+ }
+
/** Drives a build */
public boolean build(String projectName,String configFile) {
return AjdeManager.build(projectName,configFile);
File.pathSeparator + this.classPath +
File.pathSeparator + System.getProperty("aspectjrt.path") +
File.pathSeparator + "../lib/junit/junit.jar" +
+ "c:/batik/batik-1.6/lib/batik-util.jar;"+
+ "c:/batik/batik-1.6/lib/batik-awt-util.jar;"+
+ "c:/batik/batik-1.6/lib/batik-dom.jar;"+
+ "c:/batik/batik-1.6/lib/batik-svggen.jar;"+
File.pathSeparator+".."+File.separator+"lib" + File.separator+"test"+File.separator+"aspectjrt.jar";
// look at dependant projects
public static boolean informedAboutKindOfBuild;
public static boolean fullBuildOccurred;
public static List detectedDeletions = new ArrayList();
-
+ public static StringBuffer decisions = new StringBuffer();
public static void reset() {
informedAboutKindOfBuild=false;
+ decisions = new StringBuffer();
fullBuildOccurred=false;
if (detectedDeletions!=null) detectedDeletions.clear();
}
fullBuildOccurred=wasFullBuild;
}
+ public static String getDecisions() {
+ return decisions.toString();
+ }
+
public static boolean wasFullBuild() {
if (!informedAboutKindOfBuild) throw new RuntimeException("I never heard about what kind of build it was!!");
return fullBuildOccurred;
}
+
+ // not needed just yet...
+// public void recordInformation(String s) { decisions.append(s).append("\n");}
+ public void recordDecision(String s) {
+ decisions.append(s).append("\n");
+ }
};
}
\ No newline at end of file
checkXMLAspectCount("PR131505","pkg.A",1);
}
+ public void testPr133532() {
+ initialiseProject("PR133532");
+ build("PR133532");
+ alter("PR133532","inc1");
+ build("PR133532");
+ alter("PR133532","inc2");
+ build("PR133532");
+ assertTrue("There should be no errors reported:\n"+MyTaskListManager.getErrorMessages(),
+ MyTaskListManager.getErrorMessages().isEmpty());
+ }
+
+ public void testPr133532_2() {
+ initialiseProject("pr133532_2");
+ build("pr133532_2");
+ alter("pr133532_2","inc2");
+ build("pr133532_2");
+ assertTrue("There should be no errors reported:\n"+MyTaskListManager.getErrorMessages(),
+ MyTaskListManager.getErrorMessages().isEmpty());
+ String decisions = AjdeInteractionTestbed.MyStateListener.getDecisions();
+ String expect="Need to recompile 'A.aj'";
+ assertTrue("Couldn't find build decision: '"+expect+"' in the list of decisions made:\n"+decisions,
+ decisions.indexOf(expect)!=-1);
+ }
// other possible tests:
// - memory usage (freemem calls?)