Class StatelessXmlReporter
java.lang.Object
org.apache.maven.plugin.surefire.report.StatelessXmlReporter
- All Implemented Interfaces:
StatelessReportEventListener<WrappedReportEntry,
TestSetStats>
- Direct Known Subclasses:
NullStatelessXmlReporter
public class StatelessXmlReporter
extends Object
implements StatelessReportEventListener<WrappedReportEntry,TestSetStats>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
private final boolean
private final boolean
private final String
private final File
private final int
private final Map<String,
Deque<WrappedReportEntry>> private final boolean
private static final String
private static final String
private final String
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionStatelessXmlReporter
(File reportsDirectory, String reportNameSuffix, boolean trimStackTrace, int rerunFailingTestsCount, Map<String, Deque<WrappedReportEntry>> testClassMethodRunHistoryMap, String xsdSchemaLocation, String xsdVersion, boolean phrasedFileName, boolean phrasedSuiteName, boolean phrasedClassName, boolean phrasedMethodName) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addCommentElementTestCase
(String comment, OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, OutputStream fw) private static void
addOutputStreamElement
(OutputStreamWriter outputStreamWriter, StatelessXmlReporter.EncodingOutputStream eos, org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream, String name) private Deque<WrappedReportEntry>
aggregateCacheFromMultipleReruns
(WrappedReportEntry testSetReportEntry, TestSetStats testSetStats) arrangeMethodStatistics
(WrappedReportEntry testSetReportEntry, TestSetStats testSetStats) void
Clean testClassMethodRunHistoryMapprivate static boolean
containsEscapesIllegalXml10
(String message) private static void
createOutErrElements
(OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, OutputStream fw) private void
createTestSuiteElement
(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats) private static String
escape for XML 1.0private static String
extraEscapeAttribute
(String message) Handle stuff that may pop up in java that is not legal in xml.private static void
extraEscapeElementValue
(String message, OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, OutputStream fw) Writes escaped string or the message within CDATA if all characters are legal.private Deque<WrappedReportEntry>
getAddMethodRunHistoryMap
(String testClassName) private OutputStream
getOutputStream
(WrappedReportEntry testSetReportEntry) private File
getReportFile
(WrappedReportEntry report) private static void
getTestProblems
(OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace, OutputStream fw, String testErrorType, boolean createOutErrElementsInside) getTestResultType
(List<WrappedReportEntry> methodEntryList) Get the result of a test from a list of its runs in WrappedReportEntryprivate static OutputStreamWriter
getWriter
(OutputStream fos) private static boolean
isIllegalEscape
(char c) private static boolean
isIllegalEscape
(int c) private void
serializeTestClass
(OutputStream outputStream, OutputStreamWriter fw, org.apache.maven.shared.utils.xml.XMLWriter ppw, List<WrappedReportEntry> methodEntries) private void
serializeTestClassWithoutRerun
(OutputStream outputStream, OutputStreamWriter fw, org.apache.maven.shared.utils.xml.XMLWriter ppw, List<WrappedReportEntry> methodEntries) private void
serializeTestClassWithRerun
(OutputStream outputStream, OutputStreamWriter fw, org.apache.maven.shared.utils.xml.XMLWriter ppw, List<WrappedReportEntry> methodEntries) private static void
showProperties
(org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, Map<String, String> systemProperties) Adds system properties to the XML report.private void
startTestElement
(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report) void
testSetCompleted
(WrappedReportEntry testSetReportEntry, TestSetStats testSetStats) The callback is called after the test class has been completed and the state of report is final.
-
Field Details
-
XML_INDENT
- See Also:
-
XML_NL
- See Also:
-
reportsDirectory
-
reportNameSuffix
-
trimStackTrace
private final boolean trimStackTrace -
rerunFailingTestsCount
private final int rerunFailingTestsCount -
xsdSchemaLocation
-
xsdVersion
-
testClassMethodRunHistoryMap
-
phrasedFileName
private final boolean phrasedFileName -
phrasedSuiteName
private final boolean phrasedSuiteName -
phrasedClassName
private final boolean phrasedClassName -
phrasedMethodName
private final boolean phrasedMethodName
-
-
Constructor Details
-
StatelessXmlReporter
public StatelessXmlReporter(File reportsDirectory, String reportNameSuffix, boolean trimStackTrace, int rerunFailingTestsCount, Map<String, Deque<WrappedReportEntry>> testClassMethodRunHistoryMap, String xsdSchemaLocation, String xsdVersion, boolean phrasedFileName, boolean phrasedSuiteName, boolean phrasedClassName, boolean phrasedMethodName)
-
-
Method Details
-
testSetCompleted
Description copied from interface:StatelessReportEventListener
The callback is called after the test class has been completed and the state of report is final.- Specified by:
testSetCompleted
in interfaceStatelessReportEventListener<WrappedReportEntry,
TestSetStats> - Parameters:
testSetReportEntry
- WrappedReportEntrytestSetStats
- TestSetStats
-
arrangeMethodStatistics
private Map<String,Map<String, arrangeMethodStatisticsList<WrappedReportEntry>>> (WrappedReportEntry testSetReportEntry, TestSetStats testSetStats) -
aggregateCacheFromMultipleReruns
private Deque<WrappedReportEntry> aggregateCacheFromMultipleReruns(WrappedReportEntry testSetReportEntry, TestSetStats testSetStats) -
cleanTestHistoryMap
public void cleanTestHistoryMap()Clean testClassMethodRunHistoryMap -
getTestResultType
private DefaultReporterFactory.TestResultType getTestResultType(List<WrappedReportEntry> methodEntryList) Get the result of a test from a list of its runs in WrappedReportEntry- Parameters:
methodEntryList
- the list of runs for a given test- Returns:
- the TestResultType for the given test
-
getAddMethodRunHistoryMap
-
getOutputStream
- Throws:
IOException
-
getWriter
-
getReportFile
-
extraEscapeAttribute
Handle stuff that may pop up in java that is not legal in xml.- Parameters:
message
- The string- Returns:
- The escaped string or returns itself if all characters are legal
-
containsEscapesIllegalXml10
-
isIllegalEscape
private static boolean isIllegalEscape(char c) -
isIllegalEscape
private static boolean isIllegalEscape(int c) -
escapeXml
escape for XML 1.0- Parameters:
text
- The stringattribute
- true if the escaped value is inside an attribute- Returns:
- The escaped string
-