Browse Source

bz-63827 Print out the stacktrace when writing out the XML from "legacy-xml" formatter of junitlauncher

master
Jaikiran Pai 5 years ago
parent
commit
23a3665c3e
2 changed files with 10 additions and 0 deletions
  1. +7
    -0
      WHATSNEW
  2. +3
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatter.java

+ 7
- 0
WHATSNEW View File

@@ -1,6 +1,13 @@
Changes from Ant 1.10.7 TO Ant 1.10.8 Changes from Ant 1.10.7 TO Ant 1.10.8
===================================== =====================================


Fixed bugs:
-----------

* "legacy-xml" formatter of junitlauncher task wasn't writing out
the stacktrace for failures. This is now fixed.
Bugzilla Report 63827

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




+ 3
- 0
src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatter.java View File

@@ -19,6 +19,7 @@ package org.apache.tools.ant.taskdefs.optional.junitlauncher;


import org.apache.tools.ant.util.DOMElementWriter; import org.apache.tools.ant.util.DOMElementWriter;
import org.apache.tools.ant.util.DateUtils; import org.apache.tools.ant.util.DateUtils;
import org.apache.tools.ant.util.StringUtils;
import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.TestExecutionResult;
import org.junit.platform.engine.TestSource; import org.junit.platform.engine.TestSource;
import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.engine.reporting.ReportEntry;
@@ -282,6 +283,8 @@ class LegacyXmlResultFormatter extends AbstractJUnitResultFormatter implements T
writer.writeAttribute(ATTR_MESSAGE, message); writer.writeAttribute(ATTR_MESSAGE, message);
} }
writer.writeAttribute(ATTR_TYPE, t.getClass().getName()); writer.writeAttribute(ATTR_TYPE, t.getClass().getName());
// write out the stacktrace
writer.writeCData(StringUtils.getStackTrace(cause.get()));
} }
writer.writeEndElement(); writer.writeEndElement();
} }


Loading…
Cancel
Save