org.apache.fop.tools
Class TestConverter
java.lang.Object
|
+--org.apache.fop.tools.TestConverter
- public class TestConverter
- extends java.lang.Object
TestConverter is used to process a set of tests specified in
a testsuite.
This class retrieves the data in the testsuite and uses FOP
to convert the xml and xsl file into either an xml representation
of the area tree or a pdf document.
The area tree can be used for automatic comparisons between different
versions of FOP or the pdf can be view for manual checking and
pdf rendering.
Modified by Mark Lillywhite mark-fop@inomial.com to use the new Driver
interface.
Method Summary |
protected boolean |
compareFiles(java.io.File f1,
java.io.File f2)
Compare files.
|
protected org.w3c.dom.Node |
locateResult(org.w3c.dom.Node testcase,
java.lang.String id)
|
static void |
main(java.lang.String[] args)
This main method can be used to run the test converter from
the command line.
|
protected void |
runTest(org.w3c.dom.Node testcase,
org.w3c.dom.Node test)
Run a particular test.
|
protected void |
runTestCase(org.w3c.dom.Node tcase)
Run a test case.
|
java.util.Hashtable |
runTests(java.lang.String fname,
java.lang.String dest,
java.lang.String compDir)
Run the Tests.
|
void |
setBaseDir(java.lang.String str)
|
void |
setFailOnly(boolean fail)
|
void |
setOutputPDF(boolean pdf)
|
void |
setParserFeatures(org.xml.sax.XMLReader parser)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestConverter
public TestConverter()
main
public static void main(java.lang.String[] args)
- This main method can be used to run the test converter from
the command line.
This will take a specified testsuite xml and process all
tests in it.
The command line options are:
-b to set the base directory for where the testsuite and associated files are
-failOnly to process only the tests which are specified as fail in the test results
-pdf to output the result as pdf
setOutputPDF
public void setOutputPDF(boolean pdf)
setFailOnly
public void setFailOnly(boolean fail)
setBaseDir
public void setBaseDir(java.lang.String str)
runTests
public java.util.Hashtable runTests(java.lang.String fname,
java.lang.String dest,
java.lang.String compDir)
- Run the Tests.
This runs the tests specified in the xml file fname.
The document is read as a dom and each testcase is covered.
runTestCase
protected void runTestCase(org.w3c.dom.Node tcase)
- Run a test case.
This goes through a test case in the document.
A testcase can contain a test, a result or more test cases.
A test case is handled recursively otherwise the test is run.
runTest
protected void runTest(org.w3c.dom.Node testcase,
org.w3c.dom.Node test)
- Run a particular test.
This runs a test defined by the xml and xsl documents.
If the test has a result specified it is checked.
This creates an XSLTInputHandler to provide the input
for FOP and writes the data out to an XML are tree.
compareFiles
protected boolean compareFiles(java.io.File f1,
java.io.File f2)
- Compare files.
Returns true if equal.
setParserFeatures
public void setParserFeatures(org.xml.sax.XMLReader parser)
throws FOPException
locateResult
protected org.w3c.dom.Node locateResult(org.w3c.dom.Node testcase,
java.lang.String id)
Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.