Class JUnit4ReportWriter

  • All Implemented Interfaces:
    ReportWriter

    public class JUnit4ReportWriter
    extends java.lang.Object
    implements ReportWriter
    A ReportWriter that generates JUnit 4 XML reports based on the JUnit schema https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String formatTime​(long duration)  
      protected void writeErrorOrFailure​(java.io.BufferedWriter writer, ReportNode node, java.util.concurrent.atomic.AtomicBoolean errorWritten)  
      void writeReport​(ReportTreeAccessor reportTreeAccessor, java.lang.String executionId, java.io.File outputFile)
      Writes the report of the provided execution
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JUnit4ReportWriter

        public JUnit4ReportWriter()
    • Method Detail

      • writeReport

        public void writeReport​(ReportTreeAccessor reportTreeAccessor,
                                java.lang.String executionId,
                                java.io.File outputFile)
                         throws java.io.IOException
        Description copied from interface: ReportWriter
        Writes the report of the provided execution
        Specified by:
        writeReport in interface ReportWriter
        Parameters:
        reportTreeAccessor - the ReportTreeAccessor to be used to access the report node tree
        executionId - the ID of the execution to be reported
        outputFile - the output file the report has to be written to
        Throws:
        java.io.IOException - if an error occurs while writing the report
      • writeErrorOrFailure

        protected void writeErrorOrFailure​(java.io.BufferedWriter writer,
                                           ReportNode node,
                                           java.util.concurrent.atomic.AtomicBoolean errorWritten)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • formatTime

        protected java.lang.String formatTime​(long duration)