From 4624d76d0403dd32a4d5102c47e890bb0c0be6fc Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 11 Jul 2001 08:18:57 +0000 Subject: [PATCH] Give a different message if a test fails due to timeout. Submitted by: Julian M. Savage git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269313 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/taskdefs/optional/junit/JUnitTask.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java index ccbef4371..1441bd34f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java @@ -310,8 +310,7 @@ public class JUnitTask extends Task { exitValue = executeAsForked(test, watchdog); // null watchdog means no timeout, you'd better not check with null if (watchdog != null) { - //info will be used in later version do nothing for now - //wasKilled = watchdog.killedProcess(); + wasKilled = watchdog.killedProcess(); } } @@ -321,10 +320,10 @@ public class JUnitTask extends Task { boolean failureOccurredHere = exitValue != JUnitTestRunner.SUCCESS; if (errorOccurredHere && test.getHaltonerror() || failureOccurredHere && test.getHaltonfailure()) { - throw new BuildException("Test "+test.getName()+" failed", + throw new BuildException("Test "+test.getName()+" failed"+(wasKilled ? " (timeout)" : ""), location); } else if (errorOccurredHere || failureOccurredHere) { - log("TEST "+test.getName()+" FAILED", Project.MSG_ERR); + log("TEST "+test.getName()+" FAILED" + (wasKilled ? " (timeout)" : ""), Project.MSG_ERR); } }