Class ReportTransformer

java.lang.Object
org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
org.fest.swing.junit.ant.ReportTransformer

public class ReportTransformer extends org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
Transforms a JUnit XML report. The default transformation generates an HTML report in either framed or non-framed style.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer

    org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer.Format
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.apache.tools.ant.types.Path
     
    private static int
    Used to ensure the uniqueness of a property.
    private static final org.apache.tools.ant.util.FileUtils
    Instance of a utility class to use for file operations.
    private final List<org.apache.tools.ant.taskdefs.XSLTProcess.Param>
    The parameters that will be sent to the XSL transformation.
    private static final String
     

    Fields inherited from class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer

    dbfactory, document, format, FRAMES, NOFRAMES, styleDir, task, toDir
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReportTransformer(org.apache.tools.ant.Task task)
    Creates a new ReportTransformer.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.tools.ant.types.Path
    Creates the current classpath.
    private void
    createNewParams(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
     
    private void
    createOutputDirParam(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
     
    org.apache.tools.ant.taskdefs.XSLTProcess.Param
    Create an instance of an XSL parameter for configuration by Ant.
    private void
    delete(File outputFile)
     
    protected org.apache.tools.ant.types.Resource
    Access the stylesheet to be used as a resource.
    private File
    outputFile(org.apache.tools.ant.taskdefs.TempFile tempFileTask)
     
    void
    setClasspath(org.apache.tools.ant.types.Path classpath)
    Sets an additional classpath.
    void
    setClasspathRef(org.apache.tools.ant.types.Reference r)
    Sets a reference to a classpath.
    private void
    setUpTempFileTask(org.apache.tools.ant.taskdefs.TempFile tempFileTask, String tempFileProperty)
     
    private org.apache.tools.ant.taskdefs.TempFile
     
    void
    Performs the XSLT transformation to generate the HTML report.
    private org.apache.tools.ant.taskdefs.XSLTProcess
     

    Methods inherited from class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer

    checkOptions, configureForRedirectExtension, createFactory, getDocumentBuilderFactory, getStylesheetSystemId, setExtension, setFormat, setStyledir, setTodir, setXmlDocument, setXmlfile

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • XSL_FILE_PATH

      private static final String XSL_FILE_PATH
      See Also:
    • classpath

      private org.apache.tools.ant.types.Path classpath
    • params

      private final List<org.apache.tools.ant.taskdefs.XSLTProcess.Param> params
      The parameters that will be sent to the XSL transformation.
    • FILE_UTILS

      private static final org.apache.tools.ant.util.FileUtils FILE_UTILS
      Instance of a utility class to use for file operations.
    • counter

      private static int counter
      Used to ensure the uniqueness of a property.
  • Constructor Details

    • ReportTransformer

      public ReportTransformer(org.apache.tools.ant.Task task)
      Creates a new ReportTransformer.
      Parameters:
      task - task delegating to this class.
  • Method Details

    • createParam

      public org.apache.tools.ant.taskdefs.XSLTProcess.Param createParam()
      Create an instance of an XSL parameter for configuration by Ant.
      Overrides:
      createParam in class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
      Returns:
      an instance of the Param class to be configured.
    • transform

      public void transform() throws org.apache.tools.ant.BuildException
      Performs the XSLT transformation to generate the HTML report.
      Overrides:
      transform in class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
      Throws:
      org.apache.tools.ant.BuildException - thrown if something goes wrong with the transformation.
    • xsltTask

      private org.apache.tools.ant.taskdefs.XSLTProcess xsltTask()
    • getStylesheet

      protected org.apache.tools.ant.types.Resource getStylesheet()
      Access the stylesheet to be used as a resource.
      Overrides:
      getStylesheet in class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
      Returns:
      stylesheet as a resource
    • tempFileTask

      private org.apache.tools.ant.taskdefs.TempFile tempFileTask()
    • outputFile

      private File outputFile(org.apache.tools.ant.taskdefs.TempFile tempFileTask)
    • setUpTempFileTask

      private void setUpTempFileTask(org.apache.tools.ant.taskdefs.TempFile tempFileTask, String tempFileProperty)
    • createNewParams

      private void createNewParams(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
    • createOutputDirParam

      private void createOutputDirParam(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
    • delete

      private void delete(File outputFile)
    • setClasspath

      public void setClasspath(org.apache.tools.ant.types.Path classpath)
      Sets an additional classpath.
      Parameters:
      classpath - the additional classpath to append to the current one.
    • setClasspathRef

      public void setClasspathRef(org.apache.tools.ant.types.Reference r)
      Sets a reference to a classpath.
      Parameters:
      r - the reference to set.
    • createClasspath

      public org.apache.tools.ant.types.Path createClasspath()
      Creates the current classpath.
      Overrides:
      createClasspath in class org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
      Returns:
      the created classpath.