ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit XMLJUnitResultFormatter.java
Date Sat, 05 Jan 2002 01:39:40 GMT
ehatcher    02/01/04 17:39:40

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        XMLJUnitResultFormatter.java
  Log:
  Fix for Bug 5637
  NPE in JUnit XMLJunitResultFormatter if setUp() in TestSetup throws AssertionFailedError
  
  Revision  Changes    Path
  1.17      +9 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
  
  Index: XMLJUnitResultFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XMLJUnitResultFormatter.java	9 Dec 2001 13:38:18 -0000	1.16
  +++ XMLJUnitResultFormatter.java	5 Jan 2002 01:39:40 -0000	1.17
  @@ -207,6 +207,15 @@
        */
       public void endTest(Test test) {
           Element currentTest = (Element) testElements.get(test);
  +        
  +        // Fix for bug #5637 - if a junit.extensions.TestSetup is
  +        // used and throws an exception during setUp then startTest
  +        // would never have been called
  +        if (currentTest == null) {
  +            startTest(test);
  +            currentTest = (Element) testElements.get(test);
  +        }
  +        
           Long l = (Long) testStarts.get(test);
           currentTest.setAttribute(ATTR_TIME,
                                    ""+((System.currentTimeMillis()-l.longValue())
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message