From: SourceForge.net <no...@so...> - 2008-10-02 08:13:41
|
Bugs item #2141988, was opened at 2008-10-02 10:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Christophe DENEUX (cdeneux) Assigned to: Nobody/Anonymous (nobody) Summary: Qualified values and XMLAssert.assertXpathEvaluatesTo Initial Comment: I try to use XMLAssert.assertXpathEvaluatesTo to check a node value (faulcode value of a SOAP Fault). The value is a qualified value. XMLAssert.assertXpathEvaluatesTo does not work correctly with qualified value. In the namespace context, if you set a prefix different than the one in your XML document, you can't be able to have a successfull test, expect if you set the prefix provided by your XML document. My XML: <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>marche pas</faultstring><detail/></env:Fault></env:Body></env:Envelope> My namespace context: final Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("env11", "http://schemas.xmlsoap.org/soap/envelope/"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); My assert: XMLAssert.assertXpathEvaluatesTo("env11:Server", "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 |