/** * Assert that the node lists of two Xpaths in two documents are * equal or not. * @param xpathOne * @param xpathTwo * @param document * @param equality whether the values should be equal. * @see XpathEngine */ private static void assertXpathEquality(String controlXpath, Document controlDocument, String testXpath, Document testDocument, boolean equal) throws XpathException { XpathEngine xpath = XMLUnit.newXpathEngine(); Diff diff = new Diff(asXpathResultDocument(XMLUnit.newControlParser(), xpath.getMatchingNodes(controlXpath, controlDocument)), asXpathResultDocument(XMLUnit.newTestParser(), xpath.getMatchingNodes(testXpath, testDocument))); assertXMLEqual(diff, equal); }
/** * Assert that the node lists of two Xpaths in two documents are * equal or not. * @param controlXpath * @param testXpath * @param controlDocument * @param testDocument * @param equal whether the values should be equal. * @see XpathEngine */ private static void assertXpathEquality(String controlXpath, Document controlDocument, String testXpath, Document testDocument, boolean equal) throws XpathException { XpathEngine xpath = XMLUnit.newXpathEngine(); Diff diff = new Diff(asXpathResultDocument(XMLUnit.newControlParser(), xpath.getMatchingNodes(controlXpath, controlDocument)), asXpathResultDocument(XMLUnit.newTestParser(), xpath.getMatchingNodes(testXpath, testDocument))); assertXMLEqual(diff, equal); }