diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java index cb652bc96a..c2ed821756 100644 --- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java +++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java @@ -41,6 +41,8 @@ public final class ReportTestCase { private String failureErrorLine; private String failureDetail; + private String systemOut; + private String systemErr; private boolean hasFailure; @@ -138,6 +140,24 @@ public ReportTestCase setError(String message, String type) { return setFailureMessage(message).setFailureType(type); } + public String getSystemOut() { + return systemOut; + } + + public ReportTestCase setSystemOut(String message) { + systemOut = message; + return this; + } + + public String getSystemErr() { + return systemErr; + } + + public ReportTestCase setSystemErr(String message) { + systemErr = message; + return this; + } + public ReportTestCase setSkipped(String message) { hasFailure = false; hasError = false; diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java index d651b3e64c..be2d5335ff 100644 --- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java +++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java @@ -171,6 +171,11 @@ public void startElement(String uri, String localName, String qName, Attributes testCase.setError(attributes.getValue("message"), attributes.getValue("type")); currentSuite.incrementNumberOfErrors(); break; + case "system-out": + case "system-err": + currentElement = new StringBuilder(); + parseContent = true; + break; case "skipped": String message = attributes.getValue("message"); testCase.setSkipped(message != null ? message : "skipped"); @@ -210,6 +215,12 @@ public void endElement(String uri, String localName, String qName) throws SAXExc testCase.setFailureDetail(currentElement.toString()) .setFailureErrorLine(parseErrorLine(currentElement, testCase.getFullClassName())); break; + case "system-out": + testCase.setSystemOut(currentElement.toString()); + break; + case "system-err": + testCase.setSystemErr(currentElement.toString()); + break; case "time": try { defaultSuite.setTimeElapsed(Float.parseFloat(currentElement.toString()));