Class StatelessXmlReporter
- java.lang.Object
-
- org.apache.maven.plugin.surefire.report.StatelessXmlReporter
-
- Direct Known Subclasses:
NullStatelessXmlReporter
public class StatelessXmlReporter extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
StatelessXmlReporter.ByteConstantsHolder
private static class
StatelessXmlReporter.EncodingOutputStream
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
reportNameSuffix
private java.io.File
reportsDirectory
private int
rerunFailingTestsCount
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>>>
testClassMethodRunHistoryMap
private boolean
trimStackTrace
private java.lang.String
xsdSchemaLocation
-
Constructor Summary
Constructors Constructor Description StatelessXmlReporter(java.io.File reportsDirectory, java.lang.String reportNameSuffix, boolean trimStackTrace, int rerunFailingTestsCount, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>>> testClassMethodRunHistoryMap, java.lang.String xsdSchemaLocation)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addOutputStreamElement(java.io.OutputStreamWriter outputStreamWriter, StatelessXmlReporter.EncodingOutputStream eos, org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream, java.lang.String name)
void
cleanTestHistoryMap()
Clean testClassMethodRunHistoryMapprivate static boolean
containsEscapesIllegalXml10(java.lang.String message)
private static void
createOutErrElements(java.io.OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, java.io.OutputStream fw)
private void
createTestSuiteElement(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats, java.lang.String timeAsString)
private static java.lang.String
escapeXml(java.lang.String text, boolean attribute)
private static java.lang.String
extraEscape(java.lang.String message, boolean attribute)
Handle stuff that may pop up in java that is not legal in xmlprivate static void
getAddMethodEntryList(java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>> methodRunHistoryMap, WrappedReportEntry methodEntry)
private java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>>
getAddMethodRunHistoryMap(java.lang.String testClassName)
private java.io.OutputStream
getOutputStream(WrappedReportEntry testSetReportEntry)
private static java.io.File
getReportFile(ReportEntry report, java.io.File reportsDirectory, java.lang.String reportNameSuffix)
private static void
getTestProblems(java.io.OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace, java.io.OutputStream fw, java.lang.String testErrorType, boolean createOutErrElementsInside)
private DefaultReporterFactory.TestResultType
getTestResultType(java.util.List<WrappedReportEntry> methodEntryList)
Get the result of a test from a list of its runs in WrappedReportEntryprivate static java.io.OutputStreamWriter
getWriter(java.io.OutputStream fos)
private static boolean
isIllegalEscape(char c)
private static boolean
isIllegalEscape(int c)
private static void
showProperties(org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, java.util.Map<java.lang.String,java.lang.String> systemProperties)
Adds system properties to the XML report.private static void
startTestElement(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, java.lang.String reportNameSuffix, java.lang.String timeAsString)
void
testSetCompleted(WrappedReportEntry testSetReportEntry, TestSetStats testSetStats)
-
-
-
Field Detail
-
reportsDirectory
private final java.io.File reportsDirectory
-
reportNameSuffix
private final java.lang.String reportNameSuffix
-
trimStackTrace
private final boolean trimStackTrace
-
rerunFailingTestsCount
private final int rerunFailingTestsCount
-
xsdSchemaLocation
private final java.lang.String xsdSchemaLocation
-
testClassMethodRunHistoryMap
private final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>>> testClassMethodRunHistoryMap
-
-
Constructor Detail
-
StatelessXmlReporter
public StatelessXmlReporter(java.io.File reportsDirectory, java.lang.String reportNameSuffix, boolean trimStackTrace, int rerunFailingTestsCount, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>>> testClassMethodRunHistoryMap, java.lang.String xsdSchemaLocation)
-
-
Method Detail
-
testSetCompleted
public void testSetCompleted(WrappedReportEntry testSetReportEntry, TestSetStats testSetStats)
-
cleanTestHistoryMap
public void cleanTestHistoryMap()
Clean testClassMethodRunHistoryMap
-
getTestResultType
private DefaultReporterFactory.TestResultType getTestResultType(java.util.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
private java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>> getAddMethodRunHistoryMap(java.lang.String testClassName)
-
getOutputStream
private java.io.OutputStream getOutputStream(WrappedReportEntry testSetReportEntry)
-
getWriter
private static java.io.OutputStreamWriter getWriter(java.io.OutputStream fos)
-
getAddMethodEntryList
private static void getAddMethodEntryList(java.util.Map<java.lang.String,java.util.List<WrappedReportEntry>> methodRunHistoryMap, WrappedReportEntry methodEntry)
-
getReportFile
private static java.io.File getReportFile(ReportEntry report, java.io.File reportsDirectory, java.lang.String reportNameSuffix)
-
startTestElement
private static void startTestElement(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, java.lang.String reportNameSuffix, java.lang.String timeAsString) throws java.io.IOException
- Throws:
java.io.IOException
-
createTestSuiteElement
private void createTestSuiteElement(org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats, java.lang.String timeAsString) throws java.io.IOException
- Throws:
java.io.IOException
-
getTestProblems
private static void getTestProblems(java.io.OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace, java.io.OutputStream fw, java.lang.String testErrorType, boolean createOutErrElementsInside) throws java.io.IOException
- Throws:
java.io.IOException
-
createOutErrElements
private static void createOutErrElements(java.io.OutputStreamWriter outputStreamWriter, org.apache.maven.shared.utils.xml.XMLWriter ppw, WrappedReportEntry report, java.io.OutputStream fw) throws java.io.IOException
- Throws:
java.io.IOException
-
addOutputStreamElement
private static void addOutputStreamElement(java.io.OutputStreamWriter outputStreamWriter, StatelessXmlReporter.EncodingOutputStream eos, org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
showProperties
private static void showProperties(org.apache.maven.shared.utils.xml.XMLWriter xmlWriter, java.util.Map<java.lang.String,java.lang.String> systemProperties) throws java.io.IOException
Adds system properties to the XML report.- Parameters:
xmlWriter
- The test suite to report to- Throws:
java.io.IOException
-
extraEscape
private static java.lang.String extraEscape(java.lang.String message, boolean attribute)
Handle stuff that may pop up in java that is not legal in xml- Parameters:
message
- The stringattribute
- true if the escaped value is inside an attribute- Returns:
- The escaped string
-
containsEscapesIllegalXml10
private static boolean containsEscapesIllegalXml10(java.lang.String message)
-
isIllegalEscape
private static boolean isIllegalEscape(char c)
-
isIllegalEscape
private static boolean isIllegalEscape(int c)
-
escapeXml
private static java.lang.String escapeXml(java.lang.String text, boolean attribute)
-
-