Class StatelessXmlReporter

    • 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

      • 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
      • 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 string
        attribute - 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)