Class AggregateTransformer
java.lang.Object
org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer
Transform a JUnit xml report.
 The default transformation generates an html report in either framed or non-framed
 style. The non-framed style is convenient to have a concise report via mail, the
 framed report is much more convenient if you want to browse into different
 packages or testcases since it is a Javadoc like report.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classdefines acceptable formats.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static DocumentBuilderFactoryXML Parser factory accessible to subclassesprotected Documentthe xml document to processprotected Stringthe format to use for the report.static final Stringname of the frames format.static final Stringname of the no frames format.protected Filethe style directory.protected TaskTaskprotected Filethe destination directory, this is the root from where html should be generated
- 
Constructor SummaryConstructorsConstructorDescriptionAggregateTransformer(Task task) constructor creating the transformer from the junitreport task.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcheck for invalid optionsprotected voidIf we end up using the JDK's own TraX factory on Java 9+, then set the features and attributes necessary to allow redirect extensions to be used.Creates a classpath to be used for the internal XSLT task.Creates a factory configuration to be used for the internal XSLT task.Create an instance of an XSL parameter for configuration by Ant.protected static DocumentBuilderFactoryGet the Document Builder Factoryprotected Resourceaccess the stylesheet to be used as a resource.protected StringGet the systemid of the appropriate stylesheet based on its name and styledir.voidsetExtension(String ext) set the extension of the output filesvoidsetFormat(AggregateTransformer.Format format) sets the format.voidsetStyledir(File styledir) set the style directory.voidset the destination directory.voidsetXmlDocument(Document doc) sets the input document.protected voidsetXmlfile(File xmlfile) Set the xml file to be processed.voidtransformation
- 
Field Details- 
FRAMES
- 
NOFRAMES
- 
dbfactoryXML Parser factory accessible to subclasses
- 
taskTask
- 
documentthe xml document to process
- 
styleDirthe style directory. XSLs should be read from here if necessary
- 
toDirthe destination directory, this is the root from where html should be generated
- 
formatthe format to use for the report. Must beFRAMESorNOFRAMES
 
- 
- 
Constructor Details- 
AggregateTransformerconstructor creating the transformer from the junitreport task.- Parameters:
- task- task delegating to this class
 
 
- 
- 
Method Details- 
getDocumentBuilderFactoryGet the Document Builder Factory- Returns:
- the DocumentBuilderFactory instance in use
 
- 
setFormatsets the format.- Parameters:
- format- Must be- FRAMESor- NOFRAMES
 
- 
setXmlDocument
- 
setXmlfileSet the xml file to be processed. This is a helper if you want to set the file directly. Much more for testing purposes.- Parameters:
- xmlfile- xml file to be processed
- Throws:
- BuildException- if the document cannot be parsed.
 
- 
setStyledirset the style directory. It is optional and will override the default xsl used.- Parameters:
- styledir- the directory containing the xsl files if the user would like to override with its own style.
 
- 
setTodirset the destination directory.- Parameters:
- todir- the destination directory
 
- 
setExtensionset the extension of the output files- Parameters:
- ext- extension.
 
- 
createParamCreate an instance of an XSL parameter for configuration by Ant.- Returns:
- an instance of the Param class to be configured.
- Since:
- Ant 1.7
 
- 
createClasspathCreates a classpath to be used for the internal XSLT task.- Returns:
- the classpath to be configured
- Since:
- Ant 1.9.5
 
- 
createFactoryCreates a factory configuration to be used for the internal XSLT task.- Returns:
- the factory description to be configured
- Since:
- Ant 1.9.5
 
- 
transformtransformation- Throws:
- BuildException- exception if something goes wrong with the transformation.
 
- 
getStylesheetaccess the stylesheet to be used as a resource.- Returns:
- stylesheet as a resource
 
- 
checkOptionscheck for invalid options- Throws:
- BuildException- if something goes wrong.
 
- 
getStylesheetSystemIdGet the systemid of the appropriate stylesheet based on its name and styledir. If no styledir is defined it will load it as a java resource in the xsl child package, otherwise it will get it from the given directory.- Returns:
- system ID of the stylesheet.
- Throws:
- IOException- thrown if the requested stylesheet does not exist.
 
- 
configureForRedirectExtensionprotected void configureForRedirectExtension()If we end up using the JDK's own TraX factory on Java 9+, then set the features and attributes necessary to allow redirect extensions to be used.- Since:
- Ant 1.9.8
 
 
-