/** * Assert that the following XPath query selects one or more nodes. * * @param xpath * @throws Exception */ public NodeList assertValid(String xpath, Node node) throws Exception { return XPathAssert.assertValid(xpath, node, namespaces); }
public static void assertFault(Node node) throws Exception { Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("s", "http://schemas.xmlsoap.org/soap/envelope/"); namespaces.put("s12", "http://www.w3.org/2003/05/soap-envelope"); assertValid("/s:Envelope/s:Body/s:Fault", node, namespaces); assertValid("/s12:Envelope/s12:Body/s12:Fault", node, namespaces); }