Class XSLXMLReportConsumer

java.lang.Object
org.apache.batik.test.xml.XSLXMLReportConsumer
All Implemented Interfaces:
XMLTestReportProcessor.XMLReportConsumer

public class XSLXMLReportConsumer extends Object implements XMLTestReportProcessor.XMLReportConsumer
This implementation of the XMLTestReportProcessor.XMLReportConsumer interface simply applies an XSL transformation to the input XML file and stores the result in a configurable directory.
Version:
$Id: XSLXMLReportConsumer.java 1803263 2017-07-28 10:51:01Z ssteiner $
  • Field Details

    • ERROR_OUTPUT_DIRECTORY_UNUSABLE

      public static final String ERROR_OUTPUT_DIRECTORY_UNUSABLE
      Error code used when the output directory cannot be used
      See Also:
    • stylesheet

      private String stylesheet
      Stylesheet URI
    • outputDirectory

      private String outputDirectory
      Output directory, i.e., the directory where the result of the XSL transformation will be stored.
    • outputFileName

      private String outputFileName
      Output file name
  • Constructor Details

    • XSLXMLReportConsumer

      public XSLXMLReportConsumer(String stylesheet, String outputDirectory, String outputFileName)
      Constructor
      Parameters:
      stylesheet - URI for the stylesheet to apply to the XML report
      outputDirectory - directory where the result of the XSL transformation should be written
      outputFileName - name of the output report.
  • Method Details

    • onNewReport

      public void onNewReport(File xmlReport, File reportDirectory) throws Exception
      When a new report has been generated, this consumer applies the same stylesheet to the input XML document
      Specified by:
      onNewReport in interface XMLTestReportProcessor.XMLReportConsumer
      Parameters:
      xmlReport - file containing the xml report
      reportDirectory - base directory where any resource relative to the report processing should be stored.
      Throws:
      Exception
    • createNewReportOutput

      public File createNewReportOutput(File reportDirectory) throws Exception
      Returns a new file in the outputDirectory, with the requested report name.
      Throws:
      Exception
    • checkDirectory

      public void checkDirectory(File dir) throws TestException
      Checks that the input File represents a directory that can be used. If the directory does not exist, this method will attempt to create it.
      Throws:
      TestException