public class XSLXMLReportConsumer extends java.lang.Object implements XMLTestReportProcessor.XMLReportConsumer
XMLTestReportProcessor.XMLReportConsumer
interface simply applies an XSL transformation to the input
XML file and stores the result in a configurable directory.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ERROR_OUTPUT_DIRECTORY_UNUSABLE
Error code used when the output directory cannot be used
|
private java.lang.String |
outputDirectory
Output directory, i.e., the directory where the result
of the XSL transformation will be stored.
|
private java.lang.String |
outputFileName
Output file name
|
private java.lang.String |
stylesheet
Stylesheet URI
|
| Constructor and Description |
|---|
XSLXMLReportConsumer(java.lang.String stylesheet,
java.lang.String outputDirectory,
java.lang.String outputFileName)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkDirectory(java.io.File dir)
Checks that the input File represents a directory that
can be used.
|
java.io.File |
createNewReportOutput(java.io.File reportDirectory)
Returns a new file in the outputDirectory, with
the requested report name.
|
void |
onNewReport(java.io.File xmlReport,
java.io.File reportDirectory)
When a new report has been generated, this consumer
applies the same stylesheet to the input XML document
|
public static final java.lang.String ERROR_OUTPUT_DIRECTORY_UNUSABLE
private java.lang.String stylesheet
private java.lang.String outputDirectory
private java.lang.String outputFileName
public XSLXMLReportConsumer(java.lang.String stylesheet,
java.lang.String outputDirectory,
java.lang.String outputFileName)
stylesheet - URI for the stylesheet to apply to the XML reportoutputDirectory - directory where the result of the XSL transformation
should be writtenoutputFileName - name of the output report.public void onNewReport(java.io.File xmlReport,
java.io.File reportDirectory)
throws java.lang.Exception
onNewReport in interface XMLTestReportProcessor.XMLReportConsumerxmlReport - file containing the xml reportreportDirectory - base directory where any resource relative
to the report processing should be stored.java.lang.Exceptionpublic java.io.File createNewReportOutput(java.io.File reportDirectory)
throws java.lang.Exception
java.lang.Exceptionpublic void checkDirectory(java.io.File dir)
throws TestException
TestException