| org.custommonkey.xmlunit.XMLTestCase
All known Subclasses: org.custommonkey.xmlunit.test_HTMLDocumentBuilder, org.custommonkey.xmlunit.test_XMLTestCase, org.custommonkey.xmlunit.examples.ComparingPiecesOfXML, org.custommonkey.xmlunit.test_Validator, org.custommonkey.xmlunit.test_TolerantSaxDocumentBuilder, org.custommonkey.xmlunit.examples.ATourOfXMLUnit,
XMLTestCase | abstract public class XMLTestCase extends TestCase implements XSLTConstants(Code) | | JUnit TestCase subclass: extend this to add XML assertion facilities to your
test suites.
Available assertions are provided by static methods of the
XMLAssertXMLAssert class.
NB: All underlying similarity and difference testing is done using
Diff Diff instances which can be instantiated and evaluated independently of
an XMLTestCase.
See Also: Diff.similar See Also: Diff.identical See Also: Examples and more at xmlunit.sourceforge.net |
Method Summary | |
public void | assertNodeTestPasses(InputSource xml, NodeTester tester, short nodeType) Execute a NodeTest for a single node type
and assert that it passes
Parameters: xml - XML to be tested Parameters: tester - The test strategy Parameters: nodeType - The node type to be tested: constants definedin Node org.w3c.dom.Node e.g. | public void | assertNodeTestPasses(String xmlString, NodeTester tester, short nodeType) Execute a NodeTest for a single node type
and assert that it passes
Parameters: xmlString - XML to be tested Parameters: tester - The test strategy Parameters: nodeType - The node type to be tested: constants definedin Node org.w3c.dom.Node e.g. | public void | assertNodeTestPasses(NodeTest test, NodeTester tester, short[] nodeTypes, boolean assertion) Execute a NodeTest for multiple node types and make an
assertion about it whether it is expected to pass
Parameters: test - a NodeTest instance containing the XML source to be tested Parameters: tester - The test strategy Parameters: nodeTypes - The node types to be tested: constants definedin Node org.w3c.dom.Node e.g. | public void | assertXMLEqual(Diff diff, boolean assertion) Assert that the result of an XML comparison is or is not similar. | public void | assertXMLEqual(String msg, Diff diff, boolean assertion) Assert that the result of an XML comparison is or is not similar. | public void | assertXMLEqual(InputSource control, InputSource test) | public void | assertXMLEqual(String control, String test) | public void | assertXMLEqual(Document control, Document test) | public void | assertXMLEqual(Reader control, Reader test) | public void | assertXMLEqual(String err, String control, String test) | public void | assertXMLEqual(String err, InputSource control, InputSource test) | public void | assertXMLEqual(String err, Document control, Document test) | public void | assertXMLEqual(String err, Reader control, Reader test) | public void | assertXMLIdentical(Diff diff, boolean assertion) | public void | assertXMLIdentical(String msg, Diff diff, boolean assertion) | public void | assertXMLNotEqual(InputSource control, InputSource test) | public void | assertXMLNotEqual(String control, String test) | public void | assertXMLNotEqual(Document control, Document test) | public void | assertXMLNotEqual(Reader control, Reader test) | public void | assertXMLNotEqual(String err, InputSource control, InputSource test) | public void | assertXMLNotEqual(String err, String control, String test) | public void | assertXMLNotEqual(String err, Document control, Document test) | public void | assertXMLNotEqual(String err, Reader control, Reader test) | public void | assertXMLValid(InputSource xml) | public void | assertXMLValid(String xmlString) | public void | assertXMLValid(InputSource xml, String systemId) | public void | assertXMLValid(String xmlString, String systemId) | public void | assertXMLValid(InputSource xml, String systemId, String doctype) Assert that a piece of XML contains valid XML: the document
will be given a DOCTYPE to be validated with the name and
systemId specified regardless of whether it already contains a
doctype declaration. | public 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. | public void | assertXMLValid(Validator validator) | public void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, InputSource control) | public void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, String inXMLString) | public void | assertXpathEvaluatesTo(String expectedValue, String xpathExpression, Document inDocument) | public void | assertXpathExists(String xPathExpression, InputSource xml) | public void | assertXpathExists(String xPathExpression, String inXMLString) | public void | assertXpathExists(String xPathExpression, Document inDocument) | public void | assertXpathNotExists(String xPathExpression, InputSource xml) | public void | assertXpathNotExists(String xPathExpression, String inXMLString) | public void | assertXpathNotExists(String xPathExpression, Document inDocument) | public void | assertXpathValuesEqual(String controlXpath, String testXpath, Document document) | public void | assertXpathValuesEqual(String controlXpath, String testXpath, InputSource control) | public void | assertXpathValuesEqual(String controlXpath, String testXpath, String inXMLString) | public void | assertXpathValuesEqual(String controlXpath, InputSource control, String testXpath, InputSource test) | public void | assertXpathValuesEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString) | public void | assertXpathValuesEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) | public void | assertXpathValuesNotEqual(String controlXpath, String testXpath, InputSource control) | public void | assertXpathValuesNotEqual(String controlXpath, String testXpath, String inXMLString) | public void | assertXpathValuesNotEqual(String controlXpath, String testXpath, Document document) | public void | assertXpathValuesNotEqual(String controlXpath, InputSource control, String testXpath, InputSource test) | public void | assertXpathValuesNotEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString) | public void | assertXpathValuesNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) | public void | assertXpathsEqual(String controlXpath, String testXpath, InputSource document) | public void | assertXpathsEqual(String controlXpath, String testXpath, Document document) | public void | assertXpathsEqual(String controlXpath, String testXpath, String inXMLString) | public void | assertXpathsEqual(String controlXpath, InputSource control, String testXpath, InputSource test) | public void | assertXpathsEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString) | public void | assertXpathsEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) | public void | assertXpathsNotEqual(String controlXpath, String testXpath, Document document) | public void | assertXpathsNotEqual(String controlXpath, String testXpath, InputSource control) | public void | assertXpathsNotEqual(String controlXpath, String testXpath, String inXMLString) | public void | assertXpathsNotEqual(String controlXpath, InputSource control, String testXpath, InputSource test) | public void | assertXpathsNotEqual(String controlXpath, String inControlXMLString, String testXpath, String inTestXMLString) | public void | assertXpathsNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) | public Diff | compareXML(InputSource control, InputSource test) | public Diff | compareXML(Reader control, Reader test) | public Diff | compareXML(String control, Reader test) | public Diff | compareXML(Reader control, String test) | public Diff | compareXML(String control, String test) | public Diff | compareXML(Document control, Document test) |
XMLTestCase | public XMLTestCase()(Code) | | Construct a new XML test case.
|
XMLTestCase | public XMLTestCase(String name)(Code) | | Construct a new test case.
Parameters: name - Name of test |
assertNodeTestPasses | public void assertNodeTestPasses(NodeTest test, NodeTester tester, short[] nodeTypes, boolean assertion)(Code) | | Execute a NodeTest for multiple node types and make an
assertion about it whether it is expected to pass
Parameters: test - a NodeTest instance containing the XML source to be tested Parameters: tester - The test strategy Parameters: nodeTypes - The node types to be tested: constants definedin Node org.w3c.dom.Node e.g. Node.ELEMENT_NODE Parameters: assertion - true if the test is expected to pass, false otherwise See Also: AbstractNodeTester See Also: CountingNodeTester |
assertXMLEqual | public void assertXMLEqual(Diff diff, boolean assertion)(Code) | | Assert that the result of an XML comparison is or is not similar.
Parameters: diff - the result of an XML comparison Parameters: assertion - true if asserting that result is similar |
assertXMLEqual | public void assertXMLEqual(String msg, Diff diff, boolean assertion)(Code) | | Assert that the result of an XML comparison is or is not similar.
Parameters: msg - additional message to display if assertion fails Parameters: diff - the result of an XML comparison Parameters: assertion - true if asserting that result is similar |
assertXMLEqual | public void assertXMLEqual(Document control, Document test)(Code) | | Assert that two XML documents are similar
Parameters: control - XML to be compared against Parameters: test - XML to be tested |
assertXMLEqual | public void assertXMLEqual(String err, String control, String test) throws SAXException, IOException(Code) | | Assert that two XML documents are similar
Parameters: err - Message to be displayed on assertion failure Parameters: control - XML to be compared against Parameters: test - XML to be tested throws: SAXException - throws: IOException - |
assertXMLEqual | public void assertXMLEqual(String err, Document control, Document test)(Code) | | Assert that two XML documents are similar
Parameters: err - Message to be displayed on assertion failure Parameters: control - XML to be compared against Parameters: test - XML to be tested |
assertXMLEqual | public void assertXMLEqual(String err, Reader control, Reader test) throws SAXException, IOException(Code) | | Assert that two XML documents are similar
Parameters: err - Message to be displayed on assertion failure Parameters: control - XML to be compared against Parameters: test - XML to be tested throws: SAXException - throws: IOException - |
assertXMLIdentical | public void assertXMLIdentical(Diff diff, boolean assertion)(Code) | | Assert that the result of an XML comparison is or is not identical
Parameters: diff - the result of an XML comparison Parameters: assertion - true if asserting that result is identical |
assertXMLIdentical | public void assertXMLIdentical(String msg, Diff diff, boolean assertion)(Code) | | Assert that the result of an XML comparison is or is not identical
Parameters: msg - Message to display if assertion fails Parameters: diff - the result of an XML comparison Parameters: assertion - true if asserting that result is identical |
assertXMLNotEqual | public void assertXMLNotEqual(Document control, Document test)(Code) | | Assert that two XML documents are NOT similar
Parameters: control - XML to be compared against Parameters: test - XML to be tested |
assertXMLNotEqual | public void assertXMLNotEqual(String err, String control, String test) throws SAXException, IOException(Code) | | Assert that two XML documents are NOT similar
Parameters: err - Message to be displayed on assertion failure Parameters: control - XML to be compared against Parameters: test - XML to be tested throws: SAXException - throws: IOException - |
assertXMLNotEqual | public void assertXMLNotEqual(String err, Document control, Document test)(Code) | | Assert that two XML documents are NOT similar
Parameters: err - Message to be displayed on assertion failure Parameters: control - XML to be compared against Parameters: test - XML to be tested |
assertXMLNotEqual | public void assertXMLNotEqual(String err, Reader control, Reader test) throws SAXException, IOException(Code) | | Assert that two XML documents are NOT similar
Parameters: err - Message to be displayed on assertion failure Parameters: control - XML to be compared against Parameters: test - XML to be tested throws: SAXException - throws: IOException - |
assertXMLValid | public void assertXMLValid(String xmlString, String systemId, String doctype) throws SAXException, ConfigurationException(Code) | | 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.
Parameters: xmlString - Parameters: systemId - Parameters: doctype - throws: SAXException - throws: ConfigurationException - if validation could not be turned on See Also: Validator |
assertXMLValid | public void assertXMLValid(Validator validator)(Code) | | Assert that a Validator instance returns isValid() == true
Parameters: validator - |
assertXpathEvaluatesTo | public void assertXpathEvaluatesTo(String expectedValue, String xpathExpression, Document inDocument) throws XpathException(Code) | | Assert the value of an Xpath expression in an DOM Document
Parameters: expectedValue - Parameters: xpathExpression - Parameters: inDocument - Parameters: ctx - See Also: XpathEngine See Also: which provides the underlying evaluation mechanism |
assertXpathExists | public void assertXpathExists(String xPathExpression, String inXMLString) throws IOException, SAXException, XpathException(Code) | | Assert that a specific XPath exists in some given XML
Parameters: inXpathExpression - Parameters: inXMLString - See Also: XpathEngine See Also: which provides the underlying evaluation mechanism |
assertXpathExists | public void assertXpathExists(String xPathExpression, Document inDocument) throws XpathException(Code) | | Assert that a specific XPath exists in some given XML
Parameters: inXpathExpression - Parameters: inDocument - Parameters: ctx - See Also: XpathEngine See Also: which provides the underlying evaluation mechanism |
assertXpathNotExists | public void assertXpathNotExists(String xPathExpression, String inXMLString) throws IOException, SAXException, XpathException(Code) | | Assert that a specific XPath does NOT exist in some given XML
Parameters: inXpathExpression - Parameters: inXMLString - See Also: XpathEngine See Also: which provides the underlying evaluation mechanism |
assertXpathNotExists | public void assertXpathNotExists(String xPathExpression, Document inDocument) throws XpathException(Code) | | Assert that a specific XPath does NOT exist in some given XML
Parameters: inXpathExpression - Parameters: inDocument - See Also: XpathEngine See Also: which provides the underlying evaluation mechanism |
assertXpathValuesEqual | public void assertXpathValuesEqual(String controlXpath, String testXpath, Document document) throws XpathException(Code) | | Assert that the evaluation of two Xpaths in the same document are equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - See Also: XpathEngine |
assertXpathValuesEqual | public void assertXpathValuesEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) throws XpathException(Code) | | Assert that the evaluation of two Xpaths in two documents are equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - See Also: XpathEngine |
assertXpathValuesNotEqual | public void assertXpathValuesNotEqual(String controlXpath, String testXpath, Document document) throws XpathException(Code) | | Assert that the evaluation of two Xpaths in the same document are
NOT equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - |
assertXpathValuesNotEqual | public void assertXpathValuesNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) throws XpathException(Code) | | Assert that the evaluation of two Xpaths in two documents are
NOT equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - |
assertXpathsEqual | public void assertXpathsEqual(String controlXpath, String testXpath, Document document) throws XpathException(Code) | | Assert that the node lists of two Xpaths in the same document are equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - See Also: XpathEngine |
assertXpathsEqual | public void assertXpathsEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) throws XpathException(Code) | | Assert that the node lists of two Xpaths in two documents are equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - See Also: XpathEngine |
assertXpathsNotEqual | public void assertXpathsNotEqual(String controlXpath, String testXpath, Document document) throws XpathException(Code) | | Assert that the node lists of two Xpaths in the same document are NOT equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - See Also: XpathEngine |
assertXpathsNotEqual | public void assertXpathsNotEqual(String controlXpath, Document controlDocument, String testXpath, Document testDocument) throws XpathException(Code) | | Assert that the node lists of two Xpaths in two documents are NOT equal
Parameters: xpathOne - Parameters: xpathTwo - Parameters: document - See Also: XpathEngine |
compareXML | public Diff compareXML(Document control, Document test)(Code) | | Compare two XML documents provided as strings
Parameters: control - Control document Parameters: test - Document to test Diff object describing differences in documents |
|
|