Author: richard.opalka(a)jboss.com
Date: 2010-03-02 03:43:29 -0500 (Tue, 02 Mar 2010)
New Revision: 11707
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
Log:
fixing framework tests - metro AS trunk regression
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java 2010-03-02
07:38:48 UTC (rev 11706)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/httpbinding/HttpPayloadTestCase.java 2010-03-02
08:43:29 UTC (rev 11707)
@@ -50,8 +50,6 @@
{
private String reqString = "<ns1:somePayload
xmlns:ns1='http://org.jboss.ws/httpbinding'>Hello</ns1:somePayload>";
- private String resString = "<ns1:somePayload
xmlns:ns1='http://org.jboss.ws/httpbinding'>Hello:InboundLogicalHandler:OutboundLogicalHandler</ns1:somePayload>";
-
public static Test suite()
{
return new JBossWSTestSetup(HttpPayloadTestCase.class,
"jaxws-samples-httpbinding-payload.war");
@@ -70,7 +68,10 @@
Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
Element docElement = DOMUtils.sourceToElement(resPayload);
- assertEquals(DOMUtils.parse(resString), docElement);
+ assertEquals("wrong namespace: " + docElement.getNamespaceURI(),
"http://org.jboss.ws/httpbinding", docElement.getNamespaceURI());
+ assertEquals("wrong localPart: " + docElement.getLocalName(),
"somePayload", docElement.getLocalName());
+ String responseString = DOMUtils.getTextContent(docElement);
+ assertEquals("wrong content: " + responseString,
"Hello:InboundLogicalHandler:OutboundLogicalHandler", responseString);
}
private Dispatch<Source> createDispatch(String target) throws
MalformedURLException, JAXBException
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2010-03-02
07:38:48 UTC (rev 11706)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2010-03-02
08:43:29 UTC (rev 11707)
@@ -49,6 +49,7 @@
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.DOMWriter;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
/**
* Test a Provider<SOAPMessage>
@@ -115,8 +116,11 @@
if (soapHeader != null)
soapHeader.detachNode();
- String resEnvStr = DOMWriter.printNode(resEnv, false);
- assertTrue("Expected payload: " + resString, resEnvStr.indexOf(resString)
> 0);
+ Node responseBody = DOMUtils.getFirstChildElement(resEnv.getBody());
+ assertEquals("wrong namespace: " + responseBody.getNamespaceURI(),
"http://org.jboss.ws/provider", responseBody.getNamespaceURI());
+ assertEquals("wrong localPart: " + responseBody.getLocalName(),
"somePayload", responseBody.getLocalName());
+ String responseString = DOMUtils.getTextContent(responseBody);
+ assertEquals("wrong content: " + responseString,
"Hello:Inbound:LogicalSourceHandler:Outbound:LogicalSourceHandler",
responseString);
}
private Dispatch<Source> createDispatch(String target) throws
MalformedURLException, JAXBException
Show replies by date