aboutsummaryrefslogtreecommitdiffstats
path: root/taskdefs
diff options
context:
space:
mode:
authorwisberg <wisberg>2005-01-27 05:32:46 +0000
committerwisberg <wisberg>2005-01-27 05:32:46 +0000
commit048c86217eadca4f9600392aba2ccaaebd7946ed (patch)
treea2ec4f73ff5ec1333b02f7ca63de80440851c861 /taskdefs
parent1cee4fbd9be0a6579ffecb9cff14e75ddd1a1136 (diff)
downloadaspectj-048c86217eadca4f9600392aba2ccaaebd7946ed.tar.gz
aspectj-048c86217eadca4f9600392aba2ccaaebd7946ed.zip
old test for done signal
Diffstat (limited to 'taskdefs')
-rw-r--r--taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
index 25030c116..c1361cde5 100644
--- a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
+++ b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
@@ -346,6 +346,18 @@ public class AjcTaskTest extends TestCase {
return task;
}
+ /** used in testMessageHolderClassName */
+ public static class InfoHolder extends MessageHandler {
+ public InfoHolder() {
+ }
+ public boolean handleMessage(IMessage message) {
+ if (0 == IMessage.INFO.compareTo(message.getKind())) {
+ AjcTaskTest.collectMessage(message.getMessage());
+ }
+ return true;
+ }
+ }
+
/** used in testMessageHolderClassName */
public static class Holder extends MessageHandler {
public Holder() {
@@ -374,6 +386,38 @@ public class AjcTaskTest extends TestCase {
assertEquals("messages", "e", result);
}
+ public void testMessageHolderClassWithDoneSignal() {
+ AjcTask task = getTask("default.lst");
+ task.setFailonerror(false);
+ String DONE = "done";
+ task.setXDoneSignal(DONE);
+ MESSAGES.setLength(0);
+ runTest(
+ task,
+ null,
+ MessageHolderChecker.INFOS,
+ InfoHolder.class.getName());
+ final String result = MESSAGES.toString();
+ String temp = new String(result);
+ MESSAGES.setLength(0);
+ if (!temp.endsWith(DONE)) {
+ if (temp.length() > 20) {
+ temp = "..." + temp.substring(temp.length()-20, temp.length());
+ }
+ assertTrue(DONE + " is not suffix of \"" + temp + "\"", false);
+ }
+ // exactly one such message
+ temp = new String(result);
+ temp = temp.substring(0, temp.length()-DONE.length());
+ if (temp.endsWith(DONE)) {
+ temp = new String(result);
+ if (temp.length() > 20) {
+ temp = "..." + temp.substring(temp.length()-20, temp.length());
+ }
+ assertTrue(DONE + " signalled twice: \"" + temp + "\"", false);
+ }
+ }
+
public void testDefaultListForkedNoTools() {
AjcTask task = getTask("default.lst");
task.setFork(true);