org.custommonkey.xmlunit
public class XMLTestCase extends TestCase implements XSLTConstants
See Also: similar
Examples and more at xmlunit.sourceforge.net
Constructor Summary | |
---|---|
XMLTestCase()
Construct a new XML test case. | |
XMLTestCase(String name)
Construct a new test case. |
Method Summary | |
---|---|
void | assertNodeTestPasses(String xmlString, NodeTester tester, short nodeType)
Execute a NodeTest |
void | assertNodeTestPasses(NodeTest test, NodeTester tester, short[] nodeTypes, boolean assertion)
Execute a NodeTest |
void | assertNotXpathExists(String xPathExpression, String inXMLString)
Assert that a specific XPath does NOT exist in some given XML |
void | assertNotXpathExists(String xPathExpression, Document inDocument)
Assert that a specific XPath does NOT exist in some given XML |
void | assertXMLEqual(Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not similar. |
void | assertXMLEqual(Diff diff, boolean assertion, String msg)
Assert that the result of an XML comparison is or is not similar. |
void | assertXMLEqual(String msg, Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not similar. |
void | assertXMLEqual(String control, String test)
Assert that two XML documents are similar |
void | assertXMLEqual(Document control, Document test)
Assert that two XML documents are similar |
void | assertXMLEqual(Reader control, Reader test)
Assert that two XML documents are similar |
void | assertXMLEqual(String err, String control, String test)
Assert that two XML documents are similar |
void | assertXMLEqual(String err, Document control, Document test)
Assert that two XML documents are similar |
void | assertXMLEqual(String err, Reader control, Reader test)
Assert that two XML documents are similar |
void | assertXMLIdentical(Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not identical |
void | assertXMLIdentical(Diff diff, boolean assertion, String msg)
Assert that the result of an XML comparison is or is not identical |
void | assertXMLIdentical(String msg, Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not identical |
void | assertXMLNotEqual(String control, String test)
Assert that two XML documents are NOT similar |
void | assertXMLNotEqual(String err, String control, String test)
Assert that two XML documents are NOT similar |
void | assertXMLNotEqual(Document control, Document test)
Assert that two XML documents are NOT similar |
void | assertXMLNotEqual(String err, Document control, Document test)
Assert that two XML documents are NOT similar |
void | assertXMLNotEqual(Reader control, Reader test)
Assert that two XML documents are NOT similar |
void | assertXMLNotEqual(String err, Reader control, Reader test)
Assert that two XML documents are NOT similar |
void | assertXMLValid(String xmlString)
Assert that a String containing XML contains valid XML: the String must
contain a DOCTYPE declaration to be validated |
void | assertXMLValid(String xmlString, String systemId)
Assert that a String containing XML contains valid XML: the String must
contain a DOCTYPE to be validated, but the validation will use the
systemId to obtain the DTD |
void | assertXMLValid(String xmlString, String systemId, String doctype)
Assert that a String containing XML contains valid XML: the String will
be given a DOCTYPE to be validated with the name and systemId specified
regardless of whether it already contains a doctype declaration. |
void | assertXMLValid(Validator validator)
Assert that a Validator instance returns isValid() == true |
void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, String inXMLString)
Assert the value of an Xpath expression in an XML String |
void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, Document inDocument)
Assert the value of an Xpath expression in an DOM Document |
void | assertXpathExists(String xPathExpression, String inXMLString)
Assert that a specific XPath exists in some given XML |
void | assertXpathExists(String xPathExpression, Document inDocument)
Assert that a specific XPath exists in some given XML |
void | assertXpathNotExists(String xPathExpression, String inXMLString)
Assert that a specific XPath does NOT exist in some given XML |
void | assertXpathNotExists(String xPathExpression, Document inDocument)
Assert that a specific XPath does NOT exist in some given XML |
void | assertXpathsEqual(String controlXpath, String testXpath, Document document)
Assert that the node lists of two Xpaths in the same document are equal |
void | assertXpathsEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the node lists of two Xpaths in the same XML string are
equal |
void | assertXpathsEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the node lists of two Xpaths in two XML strings are equal |
void | assertXpathsEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the node lists of two Xpaths in two documents are equal |
void | assertXpathsNotEqual(String controlXpath, String testXpath, Document document)
Assert that the node lists of two Xpaths in the same document are NOT equal |
void | assertXpathsNotEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the node lists of two Xpaths in the same XML string are NOT
equal |
void | assertXpathsNotEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the node lists of two Xpaths in two XML strings are NOT equal |
void | assertXpathsNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the node lists of two Xpaths in two documents are NOT equal |
void | assertXpathValuesEqual(String controlXpath, String testXpath, Document document)
Assert that the evaluation of two Xpaths in the same document are equal |
void | assertXpathValuesEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the evaluation of two Xpaths in the same XML string are
equal |
void | assertXpathValuesEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the evaluation of two Xpaths in two XML strings are equal |
void | assertXpathValuesEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the evaluation of two Xpaths in two documents are equal |
void | assertXpathValuesNotEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the evaluation of two Xpaths in the same XML string are
NOT equal |
void | assertXpathValuesNotEqual(String controlXpath, String testXpath, Document document)
Assert that the evaluation of two Xpaths in the same document are
NOT equal |
void | assertXpathValuesNotEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the evaluation of two Xpaths in two XML strings are
NOT equal |
void | assertXpathValuesNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the evaluation of two Xpaths in two documents are
NOT equal |
Diff | compareXML(Reader control, Reader test)
Compare XML documents provided by two Reader classes |
Diff | compareXML(String control, Reader test)
Compare XML documents provided by two Reader classes |
Diff | compareXML(Reader control, String test)
Compare XML documents provided by two Reader classes |
Diff | compareXML(String control, String test)
Compare two XML documents provided as strings |
Diff | compareXML(Document control, Document test)
Compare two XML documents provided as strings |
void | setControlParser(String parser)
Overide default sax parser used to parser documents |
void | setIgnoreWhitespace(boolean ignore)
Whether to ignore whitespace in attributes and elements |
void | setTestParser(String parser)
Overide default sax parser used to parse documents |
Parameters: name Name of test
NodeTest for a single node type
and assert that it passesParameters: xmlString XML to be tested tester The test strategy nodeType The node type to be tested: constants defined
in {@link Node org.w3c.dom.Node} e.g. Node.ELEMENT_NODE
Throws: SAXException ParserConfigurationException IOException
See Also: AbstractNodeTester CountingNodeTester
NodeTest for multiple node types and make an
assertion about it whether it is expected to passParameters: test a NodeTest instance containing the XML source to be tested tester The test strategy nodeTypes The node types to be tested: constants defined
in {@link Node org.w3c.dom.Node} e.g. Node.ELEMENT_NODE
assertion true if the test is expected to pass, false otherwise
See Also: AbstractNodeTester CountingNodeTester
Deprecated: Use assertXpathNotExists instead
Assert that a specific XPath does NOT exist in some given XMLParameters: inXpathExpression inXMLString
Deprecated: Use assertXpathNotExists instead
Assert that a specific XPath does NOT exist in some given XMLParameters: inXpathExpression inDocument
Parameters: diff the result of an XML comparison assertion true if asserting that result is similar
Deprecated: Use XMLTestCase#assertXMLEqual(String, Diff, boolean) instead
Assert that the result of an XML comparison is or is not similar.Parameters: diff the result of an XML comparison assertion true if asserting that result is similar msg additional message to display if assertion fails
Parameters: msg additional message to display if assertion fails diff the result of an XML comparison assertion true if asserting that result is similar
Parameters: control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: control XML to be compared against test XML to be tested
Parameters: control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: err Message to be displayed on assertion failure control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: err Message to be displayed on assertion failure control XML to be compared against test XML to be tested
Parameters: err Message to be displayed on assertion failure control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: diff the result of an XML comparison assertion true if asserting that result is identical
Deprecated: Use XMLTestCase#assertXMLIdentical(String, Diff, boolean) instead
Assert that the result of an XML comparison is or is not identicalParameters: diff the result of an XML comparison assertion true if asserting that result is identical msg additional message to display if assertion fails
Parameters: msg Message to display if assertion fails diff the result of an XML comparison assertion true if asserting that result is identical
Parameters: control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: err Message to be displayed on assertion failure control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: control XML to be compared against test XML to be tested
Parameters: err Message to be displayed on assertion failure control XML to be compared against test XML to be tested
Parameters: control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: err Message to be displayed on assertion failure control XML to be compared against test XML to be tested
Throws: SAXException IOException ParserConfigurationException
Parameters: xmlString
Throws: SAXException ParserConfigurationException
See Also: Validator
Parameters: xmlString systemId
Throws: SAXException ParserConfigurationException
See Also: Validator
Parameters: xmlString systemId doctype
Throws: SAXException ParserConfigurationException
See Also: Validator
isValid() == true
Parameters: validator
Parameters: expectedValue xpathExpression inXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException TransformerConfigurationException
See Also: which provides the underlying evaluation mechanism
Parameters: expectedValue xpathExpression inDocument
Throws: TransformerException TransformerConfigurationException
See Also: which provides the underlying evaluation mechanism
Parameters: inXpathExpression inXMLString
See Also: which provides the underlying evaluation mechanism
Parameters: inXpathExpression inDocument
See Also: which provides the underlying evaluation mechanism
Parameters: inXpathExpression inXMLString
See Also: which provides the underlying evaluation mechanism
Parameters: inXpathExpression inDocument
See Also: which provides the underlying evaluation mechanism
Parameters: xpathOne xpathTwo document
Throws: TransformerException
See Also: SimpleXpathEngine
Parameters: xpathOne xpathTwo inXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException
Parameters: xpathOne inControlXMLString xpathTwo inTestXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException
Parameters: xpathOne xpathTwo document
Throws: TransformerException
See Also: SimpleXpathEngine
Parameters: xpathOne xpathTwo document
Throws: TransformerException
See Also: SimpleXpathEngine
Parameters: xpathOne xpathTwo inXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException
Parameters: xpathOne inControlXMLString xpathTwo inTestXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException
Parameters: xpathOne xpathTwo document
Throws: TransformerException
See Also: SimpleXpathEngine
Parameters: xpathOne xpathTwo document
Throws: TransformerException TransformerConfigurationException
See Also: SimpleXpathEngine
Parameters: xpathOne xpathTwo inXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException TransformerConfigurationException
Parameters: xpathOne inControlXMLString xpathTwo inTestXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException TransformerConfigurationException
Parameters: xpathOne xpathTwo document
Throws: TransformerException TransformerConfigurationException
See Also: SimpleXpathEngine
Parameters: xpathOne xpathTwo inXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException TransformerConfigurationException
Parameters: xpathOne xpathTwo document
Throws: TransformerException TransformerConfigurationException
Parameters: xpathOne inControlXMLString xpathTwo inTestXMLString
Throws: SAXException IOException ParserConfigurationException TransformerException TransformerConfigurationException
Parameters: xpathOne xpathTwo document
Throws: TransformerException TransformerConfigurationException
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
Deprecated: this is a global setting and should be invoked on {@link XMLUnit#setControlParser XMLUnit} instead
Overide default sax parser used to parser documentsDeprecated: this is a global setting and should be invoked on {@link XMLUnit#setIgnoreWhitespace XMLUnit} instead
Whether to ignore whitespace in attributes and elementsParameters: ignore
Deprecated: this is a global setting and should be invoked on {@link XMLUnit#setTestParser XMLUnit} instead
Overide default sax parser used to parse documents