Browse Source

Make sure JunitTestRunners return code is correct when running under JUnit4. PR 43892. Submitted by Brian Curnow.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@688083 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
8be0b6387f
4 changed files with 11 additions and 2 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +3
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java

+ 1
- 0
CONTRIBUTORS View File

@@ -30,6 +30,7 @@ Benoit Moussaud
Bernd Dutkowski
Brad Clark
Brant Langer Gurganus
Brian Curnow
Brian Deitte
Brian Felder
Bruce Atherton


+ 3
- 0
WHATSNEW View File

@@ -158,6 +158,9 @@ Fixed bugs:
filter tokens
Bugzilla Report 44226.
* failures were treated as errors in forked JUnit tests when JUnit 4
was used.
Bugzilla Report 43892.

Other changes:
--------------


+ 4
- 0
contributors.xml View File

@@ -145,6 +145,10 @@
<middle>Langer</middle>
<last>Gurganus</last>
</name>
<name>
<first>Brian</first>
<last>Curnow</last>
</name>
<name>
<first>Brian</first>
<last>Deitte</last>


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

@@ -451,9 +451,10 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
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;
}
}


Loading…
Cancel
Save