Author: peterreilly
Date: Mon Oct 30 14:29:35 2006
New Revision: 469303
URL: http://svn.apache.org/viewvc?view=rev&rev=469303
Log:
Bugzilla 36733, NPE when failure in creating parser
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=469303&r1=469302&r2=469303
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Oct 30 14:29:35 2006
@@ -18,6 +18,9 @@
* <javac> fails with NPE when compiling with eclipse ecj 3.1.x.
Bugzilla 40839.
+
+* JUnitTestRunner had a NPE when unable to create parser, the exception
+ containing the error did not get reported. Bugzilla 36733.
Other changes:
--------------
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?view=diff&rev=469303&r1=469302&r2=469303
==============================================================================
---
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
Mon Oct 30 14:29:35 2006
@@ -288,6 +288,7 @@
Test suite = null;
Throwable exception = null;
+ boolean startTestSuiteSuccess = false;
try {
@@ -368,6 +369,7 @@
long start = System.currentTimeMillis();
fireStartTestSuite();
+ startTestSuiteSuccess = true;
if (exception != null) { // had an exception constructing suite
for (int i = 0; i < formatters.size(); i++) {
((TestListener) formatters.elementAt(i))
@@ -405,8 +407,10 @@
systemError = null;
systemOut.close();
systemOut = null;
- sendOutAndErr(new String(outStrm.toByteArray()),
- new String(errStrm.toByteArray()));
+ if (startTestSuiteSuccess) {
+ sendOutAndErr(new String(outStrm.toByteArray()),
+ new String(errStrm.toByteArray()));
+ }
}
fireEndTestSuite();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]