Author: bodewig
Date: Fri Aug 22 06:49:57 2008
New Revision: 688083

URL: http://svn.apache.org/viewvc?rev=688083&view=rev
Log:
Make sure JunitTestRunners return code is correct when running under JUnit4.  
PR 43892.  Submitted by Brian Curnow.

Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/WHATSNEW
    ant/core/trunk/contributors.xml
    
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java

Modified: ant/core/trunk/CONTRIBUTORS
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?rev=688083&r1=688082&r2=688083&view=diff
==============================================================================
Binary files - no diff available.

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=688083&r1=688082&r2=688083&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Aug 22 06:49:57 2008
@@ -158,6 +158,9 @@
    filter tokens
    Bugzilla Report 44226.
    
+ * failures were treated as errors in forked JUnit tests when JUnit 4
+   was used.
+   Bugzilla Report 43892.
 
 Other changes:
 --------------

Modified: ant/core/trunk/contributors.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/contributors.xml?rev=688083&r1=688082&r2=688083&view=diff
==============================================================================
--- ant/core/trunk/contributors.xml (original)
+++ ant/core/trunk/contributors.xml Fri Aug 22 06:49:57 2008
@@ -147,6 +147,10 @@
   </name>
   <name>
     <first>Brian</first>
+    <last>Curnow</last>
+  </name>
+  <name>
+    <first>Brian</first>
     <last>Deitte</last>
   </name>
   <name>

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java?rev=688083&r1=688082&r2=688083&view=diff
==============================================================================
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
 Fri Aug 22 06:49:57 2008
@@ -451,9 +451,10 @@
         }
         fireEndTestSuite();
 
-        if (retCode != SUCCESS || res.errorCount() != 0) {
+        // junitTest has the correct counts for JUnit4, while res doesn't
+        if (retCode != SUCCESS || junitTest.errorCount() != 0) {
             retCode = ERRORS;
-        } else if (res.failureCount() != 0) {
+        } else if (junitTest.failureCount() != 0) {
             retCode = FAILURES;
         }
     }


Reply via email to