private boolean receivedBatchBuildMessage = false;
private List errorMessages = new ArrayList();
private List warningMessages = new ArrayList();
+ private List weavingMessages = new ArrayList();
public static void reset() {
_instance.receivedNonIncrementalBuildMessage=false;
_instance.receivedBatchBuildMessage=false;
_instance.errorMessages.clear();
_instance.warningMessages.clear();
+ _instance.weavingMessages.clear();
}
// public static boolean defaultedToBatch() {
return _instance.warningMessages;
}
+ public static List/*IMessage*/ getWeavingMessages() {
+ return _instance.weavingMessages;
+ }
+
public static TaskListManager getInstance() {
return _instance;
}
// if (message.getMessage().startsWith(CANT_BUILD_INCREMENTAL_INDICATION)) _instance.receivedNonIncrementalBuildMessage=true;
// if (message.getMessage().startsWith(DOING_BATCH_BUILD_INDICATION)) _instance.receivedBatchBuildMessage=true;
// }
- if (message.getKind()==IMessage.ERROR) {
- errorMessages.add(message);
- }
- if (message.getKind()==IMessage.WARNING) {
- warningMessages.add(message);
- }
+ if (message.getKind()==IMessage.ERROR) errorMessages.add(message);
+ if (message.getKind()==IMessage.WARNING) warningMessages.add(message);
+ if (message.getKind()==IMessage.WEAVEINFO) weavingMessages.add(message);
log("TaskListManager.addSourcelineTask("+message+")");
}
}
public void testPr112736() {
- AjdeInteractionTestbed.VERBOSE = true;
+ // AjdeInteractionTestbed.VERBOSE = true;
initialiseProject("PR112736");
build("PR112736");
checkWasFullBuild();
checkWasFullBuild(); // back to the source
}
+
+ public void testPr128655() {
+ configureNonStandardCompileOptions("-showWeaveInfo");
+ initialiseProject("pr128655");
+ build("pr128655");
+ List firstBuildMessages = MyTaskListManager.getWeavingMessages();
+ assertTrue("Should be at least one message about the dec @type, but there were none",firstBuildMessages.size()>0);
+ alter("pr128655","inc1");
+ build("pr128655");
+ checkWasntFullBuild(); // back to the source
+ List secondBuildMessages = MyTaskListManager.getWeavingMessages();
+ // check they are the same
+ for (int i = 0; i < firstBuildMessages.size(); i++) {
+ IMessage m1 = (IMessage)firstBuildMessages.get(i);
+ IMessage m2 = (IMessage)secondBuildMessages.get(i);
+ if (!m1.toString().equals(m2.toString())) {
+ System.err.println("Message during first build was: "+m1);
+ System.err.println("Message during second build was: "+m1);
+ fail("The two messages should be the same, but are not: \n"+m1+"!="+m2);
+ }
+ }
+ }
+
+ // Similar to above, but now the annotation is in the default package
+ public void testPr128655_2() {
+ configureNonStandardCompileOptions("-showWeaveInfo");
+ initialiseProject("pr128655_2");
+ build("pr128655_2");
+ List firstBuildMessages = MyTaskListManager.getWeavingMessages();
+ assertTrue("Should be at least one message about the dec @type, but there were none",firstBuildMessages.size()>0);
+ alter("pr128655_2","inc1");
+ build("pr128655_2");
+ checkWasntFullBuild(); // back to the source
+ List secondBuildMessages = MyTaskListManager.getWeavingMessages();
+ // check they are the same
+ for (int i = 0; i < firstBuildMessages.size(); i++) {
+ IMessage m1 = (IMessage)firstBuildMessages.get(i);
+ IMessage m2 = (IMessage)secondBuildMessages.get(i);
+ if (!m1.toString().equals(m2.toString())) {
+ System.err.println("Message during first build was: "+m1);
+ System.err.println("Message during second build was: "+m1);
+ fail("The two messages should be the same, but are not: \n"+m1+"!="+m2);
+ }
+ }
+ }
+
// other possible tests:
// - memory usage (freemem calls?)
// - relationship map