diff options
author | aclement <aclement> | 2006-02-21 09:25:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-02-21 09:25:09 +0000 |
commit | 67a3319816f88e64f933f1ab3d87f02ca446bc15 (patch) | |
tree | a1419f5b96d7c20137683df101948dce98657db4 /tests/src | |
parent | f95d2c96edd293b98c27a19bb9f3cc2748b365cb (diff) | |
download | aspectj-67a3319816f88e64f933f1ab3d87f02ca446bc15.tar.gz aspectj-67a3319816f88e64f933f1ab3d87f02ca446bc15.zip |
testcode for 128655
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java | 15 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java | 48 |
2 files changed, 56 insertions, 7 deletions
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index 3af1d2fb2..e8f0e4d08 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -626,12 +626,14 @@ public class AjdeInteractionTestbed extends TestCase { 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() { @@ -654,6 +656,10 @@ public class AjdeInteractionTestbed extends TestCase { return _instance.warningMessages; } + public static List/*IMessage*/ getWeavingMessages() { + return _instance.weavingMessages; + } + public static TaskListManager getInstance() { return _instance; } @@ -668,12 +674,9 @@ public class AjdeInteractionTestbed extends TestCase { // 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+")"); } diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 0623ee58a..7a13abed5 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -515,7 +515,7 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed { } public void testPr112736() { - AjdeInteractionTestbed.VERBOSE = true; + // AjdeInteractionTestbed.VERBOSE = true; initialiseProject("PR112736"); build("PR112736"); checkWasFullBuild(); @@ -547,6 +547,52 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed { 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 |