Browse Source

never filter out the first line of the exception stack trace in junit so the failure message is preserved

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1154551 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
d121ce11a1
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
  2. +1
    -1
      src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml

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

@@ -1018,11 +1018,13 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR

String line;
try {
boolean firstLine = true;
while ((line = br.readLine()) != null) {
if (!filterLine(line)) {
if (firstLine || !filterLine(line)) {
pw.write(line);
pw.newLine();
}
firstLine = false;
}
} catch (Exception e) {
return stack; // return the stack unfiltered


+ 1
- 1
src/tests/antunit/taskdefs/optional/junit/xmlformatter-test.xml View File

@@ -87,7 +87,7 @@ public class A extends TestCase {
value="AssertionFailedError: &&"/>
</target>

<target name="XtestMessageWithTheWordMore">
<target name="testMessageWithTheWordMore">
<mkdir dir="${input}/org/example"/>
<echo file="${input}/org/example/A.java"><![CDATA[
package org.example;


Loading…
Cancel
Save