Browse Source

Give a different message if a test fails due to timeout.

Submitted by:	Julian M. Savage <jsavage@fisci.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269313 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
4624d76d04
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

+ 3
- 4
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -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);
}
}



Loading…
Cancel
Save