Browse Source

Bugzilla 36733, NPE when failure in creating parser

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@469303 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
ac78dc1602
2 changed files with 9 additions and 2 deletions
  1. +3
    -0
      WHATSNEW
  2. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java

+ 3
- 0
WHATSNEW View File

@@ -18,6 +18,9 @@ Fixed bugs:


* <javac> fails with NPE when compiling with eclipse ecj 3.1.x. * <javac> fails with NPE when compiling with eclipse ecj 3.1.x.
Bugzilla 40839. Bugzilla 40839.

* JUnitTestRunner had a NPE when unable to create parser, the exception
containing the error did not get reported. Bugzilla 36733.
Other changes: Other changes:
-------------- --------------


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

@@ -288,6 +288,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR


Test suite = null; Test suite = null;
Throwable exception = null; Throwable exception = null;
boolean startTestSuiteSuccess = false;


try { try {


@@ -368,6 +369,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();


fireStartTestSuite(); fireStartTestSuite();
startTestSuiteSuccess = true;
if (exception != null) { // had an exception constructing suite if (exception != null) { // had an exception constructing suite
for (int i = 0; i < formatters.size(); i++) { for (int i = 0; i < formatters.size(); i++) {
((TestListener) formatters.elementAt(i)) ((TestListener) formatters.elementAt(i))
@@ -405,8 +407,10 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
systemError = null; systemError = null;
systemOut.close(); systemOut.close();
systemOut = null; systemOut = null;
sendOutAndErr(new String(outStrm.toByteArray()),
new String(errStrm.toByteArray()));
if (startTestSuiteSuccess) {
sendOutAndErr(new String(outStrm.toByteArray()),
new String(errStrm.toByteArray()));
}
} }
fireEndTestSuite(); fireEndTestSuite();




Loading…
Cancel
Save