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 classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanprivate final booleanprivate final booleanprivate final Stringprivate final Fileprivate final intprivate final Map<String,Deque<WrappedReportEntry>> private final booleanprivate static final Stringprivate static final Stringprivate final Stringprivate 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 voidaddCommentElementTestCase(String comment, OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, OutputStream fw) private static voidaddOutputStreamElement(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) voidClean testClassMethodRunHistoryMapprivate static booleancontainsEscapesIllegalXml10(String message) private static voidcreateOutErrElements(OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, OutputStream fw) private voidcreateTestSuiteElement(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats) private static Stringescape for XML 1.0private static StringextraEscapeAttribute(String message) Handle stuff that may pop up in java that is not legal in xml.private static voidextraEscapeElementValue(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 OutputStreamgetOutputStream(WrappedReportEntry testSetReportEntry) private FilegetReportFile(WrappedReportEntry report) private static voidgetTestProblems(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 OutputStreamWritergetWriter(OutputStream fos) private static booleanisIllegalEscape(char c) private static booleanisIllegalEscape(int c) private voidserializeTestClass(OutputStream outputStream, OutputStreamWriter fw, org.apache.maven.shared.utils.xml.XMLWriter ppw, List<WrappedReportEntry> methodEntries) private voidserializeTestClassWithoutRerun(OutputStream outputStream, OutputStreamWriter fw, org.apache.maven.shared.utils.xml.XMLWriter ppw, List<WrappedReportEntry> methodEntries) private voidserializeTestClassWithRerun(OutputStream outputStream, OutputStreamWriter fw, org.apache.maven.shared.utils.xml.XMLWriter ppw, List<WrappedReportEntry> methodEntries) private static voidshowProperties(org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, Map<String, String> systemProperties) Adds system properties to the XML report.private voidstartTestElement(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report) voidtestSetCompleted(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:StatelessReportEventListenerThe callback is called after the test class has been completed and the state of report is final.- Specified by:
testSetCompletedin 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
-