org.custommonkey.xmlunit
public class XMLAssert extends Assert implements XSLTConstants
assertXMLEqual
assertXMLNotEqual
assertXMLIdentical
assertXMLEqual
is sufficientassertXpathExists
assertXpathNotExists
assertXpathsEqual
assertXpathsNotEqual
assertXpathValuesEqual
assertXpathValuesNotEqual
assertXpathEvaluatesTo
assertXMLValid
assertNodeTestPasses
NodeTest
Diff
instances which can be instantiated and evaluated
independently of this class.See Also: similar
Examples and more at xmlunit.sourceforge.net
Constructor Summary | |
---|---|
protected | XMLAssert() |
Method Summary | |
---|---|
static void | assertNodeTestPasses(String xmlString, NodeTester tester, short nodeType)
Execute a NodeTest |
static void | assertNodeTestPasses(NodeTest test, NodeTester tester, short[] nodeTypes, boolean assertion)
Execute a NodeTest |
static void | assertXMLEqual(Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not similar. |
static void | assertXMLEqual(String msg, Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not similar. |
static void | assertXMLEqual(String control, String test)
Assert that two XML documents are similar |
static void | assertXMLEqual(Document control, Document test)
Assert that two XML documents are similar |
static void | assertXMLEqual(Reader control, Reader test)
Assert that two XML documents are similar |
static void | assertXMLEqual(String err, String control, String test)
Assert that two XML documents are similar |
static void | assertXMLEqual(String err, Document control, Document test)
Assert that two XML documents are similar |
static void | assertXMLEqual(String err, Reader control, Reader test)
Assert that two XML documents are similar |
static void | assertXMLIdentical(Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not identical |
static void | assertXMLIdentical(Diff diff, boolean assertion, String msg)
Assert that the result of an XML comparison is or is not identical |
static void | assertXMLIdentical(String msg, Diff diff, boolean assertion)
Assert that the result of an XML comparison is or is not identical |
static void | assertXMLNotEqual(String control, String test)
Assert that two XML documents are NOT similar |
static void | assertXMLNotEqual(String err, String control, String test)
Assert that two XML documents are NOT similar |
static void | assertXMLNotEqual(Document control, Document test)
Assert that two XML documents are NOT similar |
static void | assertXMLNotEqual(String err, Document control, Document test)
Assert that two XML documents are NOT similar |
static void | assertXMLNotEqual(Reader control, Reader test)
Assert that two XML documents are NOT similar |
static void | assertXMLNotEqual(String err, Reader control, Reader test)
Assert that two XML documents are NOT similar |
static void | assertXMLValid(String xmlString)
Assert that a String containing XML contains valid XML: the String must
contain a DOCTYPE declaration to be validated |
static 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 |
static 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. |
static void | assertXMLValid(Validator validator)
Assert that a Validator instance returns isValid() == true |
static void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, String inXMLString)
Assert the value of an Xpath expression in an XML String |
static void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, Document inDocument)
Assert the value of an Xpath expression in an DOM Document |
static void | assertXpathExists(String xPathExpression, String inXMLString)
Assert that a specific XPath exists in some given XML |
static void | assertXpathExists(String xPathExpression, Document inDocument)
Assert that a specific XPath exists in some given XML |
static void | assertXpathNotExists(String xPathExpression, String inXMLString)
Assert that a specific XPath does NOT exist in some given XML |
static void | assertXpathNotExists(String xPathExpression, Document inDocument)
Assert that a specific XPath does NOT exist in some given XML |
static void | assertXpathsEqual(String controlXpath, String testXpath, Document document)
Assert that the node lists of two Xpaths in the same document are equal |
static void | assertXpathsEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the node lists of two Xpaths in the same XML string are
equal |
static void | assertXpathsEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the node lists of two Xpaths in two XML strings are equal |
static void | assertXpathsEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the node lists of two Xpaths in two documents are equal |
static void | assertXpathsNotEqual(String controlXpath, String testXpath, Document document)
Assert that the node lists of two Xpaths in the same document are NOT equal |
static void | assertXpathsNotEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the node lists of two Xpaths in the same XML string are NOT
equal |
static 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 |
static void | assertXpathsNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the node lists of two Xpaths in two documents are NOT equal |
static void | assertXpathValuesEqual(String controlXpath, String testXpath, Document document)
Assert that the evaluation of two Xpaths in the same document are equal |
static void | assertXpathValuesEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the evaluation of two Xpaths in the same XML string are
equal |
static void | assertXpathValuesEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the evaluation of two Xpaths in two XML strings are equal |
static void | assertXpathValuesEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the evaluation of two Xpaths in two documents are equal |
static void | assertXpathValuesNotEqual(String controlXpath, String testXpath, String inXMLString)
Assert that the evaluation of two Xpaths in the same XML string are
NOT equal |
static void | assertXpathValuesNotEqual(String controlXpath, String testXpath, Document document)
Assert that the evaluation of two Xpaths in the same document are
NOT equal |
static void | assertXpathValuesNotEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString)
Assert that the evaluation of two Xpaths in two XML strings are
NOT equal |
static void | assertXpathValuesNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument)
Assert that the evaluation of two Xpaths in two documents are
NOT equal |
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 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 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
Parameters: diff the result of an XML comparison assertion true if asserting that result is similar
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