org.custommonkey.xmlunit
public final class XMLUnit extends Object
Method Summary | |
---|---|
static Document | buildControlDocument(String fromXML)
Utility method to build a Document using the control DocumentBuilder
to parse the specified String. |
static Document | buildControlDocument(InputSource fromSource)
Utility method to build a Document using the control DocumentBuilder
and the specified InputSource |
static Document | buildDocument(DocumentBuilder withBuilder, Reader fromReader)
Utility method to build a Document using a specific DocumentBuilder
and reading characters from a specific Reader. |
static Document | buildDocument(DocumentBuilder withBuilder, InputSource fromSource)
Utility method to build a Document using a specific DocumentBuilder
and a specific InputSource |
static Document | buildTestDocument(String fromXML)
Utility method to build a Document using the test DocumentBuilder
to parse the specified String. |
static Document | buildTestDocument(InputSource fromSource)
Utility method to build a Document using the test DocumentBuilder
and the specified InputSource |
static Diff | compare(Reader control, Reader test)
Compare XML documents provided by two Reader classes. |
static Diff | compare(InputSource control, InputSource test)
Compare two XML documents provided by SAX InputSources |
static Diff | compare(String control, Reader test)
Compare two XML documents provided by a string and a Reader. |
static Diff | compare(Reader control, String test)
Compare two XML documents provided by a Reader and a string. |
static Diff | compare(String control, String test)
Compare two XML documents provided as strings. |
static Diff | compareXML(Reader control, Reader test)
Compare XML documents provided by two Reader classes |
static Diff | compareXML(String control, Reader test)
Compare XML documents provided by two Reader classes |
static Diff | compareXML(Reader control, String test)
Compare XML documents provided by two Reader classes |
static Diff | compareXML(String control, String test)
Compare two XML documents provided as strings |
static Diff | compareXML(Document control, Document test)
Compare two XML documents provided as strings |
static DocumentBuilderFactory | getControlDocumentBuilderFactory()
Get the DocumentBuilderFactory instance used to instantiate
parsers for the control XML in an XMLTestCase. |
static DocumentBuilder | getControlParser()
Get the DocumentBuilder instance used to parse the control
XML in an XMLTestCase. |
static boolean | getIgnoreWhitespace()
Whether to ignore whitespace when comparing node values. |
static SAXParserFactory | getSAXParserFactory()
Get the SAX parser to use in tests. |
static Transform | getStripWhitespaceTransform(Document forDocument)
Obtain the transformation that will strip whitespace from a DOM containing
empty Text nodes |
static DocumentBuilderFactory | getTestDocumentBuilderFactory()
Get the DocumentBuilderFactory instance used to instantiate
parsers for the test XML in an XMLTestCase. |
static DocumentBuilder | getTestParser()
Get the DocumentBuilder instance used to parse the test XML
in an XMLTestCase. |
static TransformerFactory | getTransformerFactory()
Get the transformer to use for XSLT transformations (and by
implication serialization and XPaths). |
static String | getVersion()
Place holder for current version info. |
static void | setControlDocumentBuilderFactory(DocumentBuilderFactory factory)
Override the DocumentBuilderFactory used to instantiate
parsers for the control XML in an XMLTestCase. |
static void | setControlParser(String className)
Overide the DocumentBuilder to use to parse control documents.
|
static void | setIgnoreWhitespace(boolean ignore)
Whether to ignore whitespace when comparing node values.
|
static void | setSAXParserFactory(String className)
Override the SAX parser to use in tests.
|
static void | setTestDocumentBuilderFactory(DocumentBuilderFactory factory)
Override the DocumentBuilderFactory used to instantiate
parsers for the test XML in an XMLTestCase. |
static void | setTestParser(String className)
Overide the DocumentBuilder to use to parser test documents.
|
static void | setTransformerFactory(String className)
Overide the transformer to use for XSLT transformations (and by
implication serialization and XPaths).
|
Parameters: fromXML
Returns: Document representation of the String content
Throws: SAXException IOException ParserConfigurationException
Parameters: fromSource
Returns: Document representation of the String content
Throws: SAXException IOException ParserConfigurationException
Parameters: withBuilder fromReader
Returns: Document built
Throws: SAXException IOException
Parameters: withBuilder fromSource
Returns: Document built
Throws: SAXException IOException
Parameters: fromXML
Returns: Document representation of the String content
Throws: SAXException IOException ParserConfigurationException
Parameters: fromSource
Returns: Document representation of the String content
Throws: SAXException IOException ParserConfigurationException
Deprecated: use Diff constructor directly
Compare XML documents provided by two Reader classes.Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Deprecated: use Diff constructor directly
Compare two XML documents provided by SAXInputSources
Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Deprecated: use Diff constructor directly
Compare two XML documents provided by a string and a Reader.Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Deprecated: use Diff constructor directly
Compare two XML documents provided by a Reader and a string.Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Deprecated: use Diff constructor directly
Compare two XML documents provided as strings.Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
Throws: SAXException IOException ParserConfigurationException
Parameters: control Control document test Document to test
Returns: Diff object describing differences in documents
DocumentBuilderFactory
instance used to instantiate
parsers for the control XML in an XMLTestCase.Returns: factory for control parsers
DocumentBuilder
instance used to parse the control
XML in an XMLTestCase.Returns: parser for control values
Throws: ParserConfigurationException
Returns: true if whitespace should be ignored when comparing nodes, false otherwise
Returns: the SAXParserFactory instance used by the Validator
to perform DTD validation
Parameters: forDocument
Returns: a Transform
to do the whitespace stripping
Throws: TransformerConfigurationException
DocumentBuilderFactory
instance used to instantiate
parsers for the test XML in an XMLTestCase.Returns: factory for test parsers
DocumentBuilder
instance used to parse the test XML
in an XMLTestCase.Returns: parser for test values
Throws: ParserConfigurationException
Returns: the current transformer factory in use
Throws: TransformerFactoryConfigurationError if unable to construct a new instance of the default transformer factory TransformerFactoryConfigurationError
Returns: current version
DocumentBuilderFactory
used to instantiate
parsers for the control XML in an XMLTestCase.setIgnoringElementContentWhitespace()
on the underlying control AND test document builder factories. Validator class
Parameters: className
DocumentBuilderFactory
used to instantiate
parsers for the test XML in an XMLTestCase.Throws: TransformerFactoryConfigurationError