You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2001/07/11 10:18:58 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java

bodewig     01/07/11 01:18:58

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
  Log:
  Give a different message if a test fails due to timeout.
  
  Submitted by:	Julian M. Savage <js...@fisci.com>
  
  Revision  Changes    Path
  1.19      +3 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JUnitTask.java	2001/05/03 15:03:58	1.18
  +++ JUnitTask.java	2001/07/11 08:18:57	1.19
  @@ -310,8 +310,7 @@
               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 @@
           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);
           }
       }