|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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. In the framed report, there are 3 frames:
Inner Class Summary | |
protected static class |
AggregateTransformer.PackageFilter
allow us to check if the node is a object of a specific package. |
Field Summary | |
static java.lang.String |
ALLCLASSES
|
static java.lang.String |
ALLPACKAGES
|
static java.lang.String |
CLASS_DETAILS
|
static java.lang.String |
CLASSES_LIST
|
protected static javax.xml.parsers.DocumentBuilderFactory |
dbfactory
XML Parser factory |
protected org.w3c.dom.Document |
document
the xml document to process |
protected java.lang.String |
extension
the file extension of the generated files. |
protected java.lang.String |
format
the format to use for the report. |
static java.lang.String |
FRAMES
|
static java.lang.String |
NOFRAMES
|
static java.lang.String |
OVERVIEW_PACKAGES
|
static java.lang.String |
OVERVIEW_SUMMARY
|
static java.lang.String |
PACKAGE_SUMMARY
|
protected java.io.File |
styleDir
the style directory. |
protected Task |
task
Task |
protected java.io.File |
toDir
the destination directory, this is the root from where html should be generated |
Constructor Summary | |
AggregateTransformer(Task task)
|
Method Summary | |
protected org.w3c.dom.Element |
buildDocument(org.w3c.dom.NodeList list)
Create an element root ("testsuites") and import all nodes as children of this element. |
protected void |
checkOptions()
check for invalid options |
protected void |
createAllPackageDetails(org.w3c.dom.Element root)
create the html resulting page of the summary of each package of the root element. |
protected void |
createAllTestSuiteDetails(org.w3c.dom.Element root)
create all resulting html pages for all testsuites. |
protected void |
createCascadingStyleSheet()
|
protected void |
createClassList(org.w3c.dom.Node root)
Create the list of all classes. |
protected void |
createFrameStructure()
|
protected void |
createPackageDetails(org.w3c.dom.Node root,
java.lang.String pkgname)
create the html resulting page of the summary of a package . |
protected void |
createPackageList(org.w3c.dom.Node root)
Create the list of all packages. |
protected void |
createPackageOverview(org.w3c.dom.Node root)
Create the summary used in the overview. |
protected void |
createSinglePageSummary(org.w3c.dom.Element root)
create a single page summary |
protected void |
createTestSuiteDetails(org.w3c.dom.Element testsuite)
create the html resulting page of one testsuite. |
protected java.lang.String |
getExtension()
get the extension, if it is null, it will use .html as the default |
protected java.util.Enumeration |
getPackages(org.w3c.dom.Element root)
|
protected org.apache.xalan.xslt.XSLTInputSource |
getXSLStreamSource(java.lang.String name)
default xsls are embedded in the distribution jar. |
protected java.lang.String |
packageToPath(java.lang.String pkgname)
|
protected org.w3c.dom.Document |
readDocument(java.io.File file)
read the xml file that should be the resuiting file of the testcase. |
void |
setExtension(java.lang.String ext)
set the extension of the output files |
void |
setFormat(java.lang.String format)
|
void |
setStyledir(java.io.File styledir)
set the style directory. |
void |
setTodir(java.io.File todir)
set the destination directory |
void |
setXmlDocument(org.w3c.dom.Document doc)
|
void |
transform()
|
protected void |
transform(org.w3c.dom.Node root,
java.lang.String xslname,
java.lang.String htmlname)
Apply a template on a part of the xml document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ALLPACKAGES
public static final java.lang.String ALLCLASSES
public static final java.lang.String OVERVIEW_PACKAGES
public static final java.lang.String CLASS_DETAILS
public static final java.lang.String CLASSES_LIST
public static final java.lang.String PACKAGE_SUMMARY
public static final java.lang.String OVERVIEW_SUMMARY
public static final java.lang.String FRAMES
public static final java.lang.String NOFRAMES
protected Task task
protected org.w3c.dom.Document document
protected java.io.File styleDir
protected java.io.File toDir
protected java.lang.String format
protected java.lang.String extension
protected static final javax.xml.parsers.DocumentBuilderFactory dbfactory
Constructor Detail |
public AggregateTransformer(Task task)
Method Detail |
public void setFormat(java.lang.String format)
public void setXmlDocument(org.w3c.dom.Document doc)
public void setStyledir(java.io.File styledir)
styledir
- the directory containing the xsl files if the user
would like to override with its own style.public void setTodir(java.io.File todir)
public void setExtension(java.lang.String ext)
protected java.lang.String getExtension()
public void transform() throws BuildException
protected void checkOptions() throws BuildException
protected void createSinglePageSummary(org.w3c.dom.Element root) throws java.io.IOException, org.xml.sax.SAXException
protected org.w3c.dom.Document readDocument(java.io.File file) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
filename
- name of the xml resulting file of the testcase.protected void createCascadingStyleSheet() throws java.io.IOException, org.xml.sax.SAXException
protected void createFrameStructure() throws java.io.IOException, org.xml.sax.SAXException
protected void createPackageList(org.w3c.dom.Node root) throws org.xml.sax.SAXException
root
- root of the xml document.protected void createClassList(org.w3c.dom.Node root) throws org.xml.sax.SAXException
root
- root of the xml document.protected void createPackageOverview(org.w3c.dom.Node root) throws org.xml.sax.SAXException
root
- root of the xml document.protected java.util.Enumeration getPackages(org.w3c.dom.Element root)
protected void createAllTestSuiteDetails(org.w3c.dom.Element root) throws org.xml.sax.SAXException
root
- should be 'testsuites' node.protected void createTestSuiteDetails(org.w3c.dom.Element testsuite) throws org.xml.sax.SAXException
root
- should be 'testsuite' node.protected void createAllPackageDetails(org.w3c.dom.Element root) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
root
- should be 'testsuites' node.protected java.lang.String packageToPath(java.lang.String pkgname)
protected void createPackageDetails(org.w3c.dom.Node root, java.lang.String pkgname) throws org.xml.sax.SAXException
root
- should be 'testsuites' node.pkgname
- Name of the package that we want a summary.protected org.w3c.dom.Element buildDocument(org.w3c.dom.NodeList list) throws javax.xml.parsers.ParserConfigurationException
protected void transform(org.w3c.dom.Node root, java.lang.String xslname, java.lang.String htmlname) throws org.xml.sax.SAXException
root
- root of the document fragmentxslfile
- style fileoutfilename
- filename of the result of the style applied on the Nodeorg.xml.sax.SAXException
- SAX Parsing Error on the style Sheet.protected org.apache.xalan.xslt.XSLTInputSource getXSLStreamSource(java.lang.String name) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |