Author: richard.opalka(a)jboss.com
Date: 2009-10-30 02:23:57 -0400 (Fri, 30 Oct 2009)
New Revision: 11071
Modified:
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
Log:
[JBPAPP-2825] Fixing test (no changes to the stack behaviour)
Modified:
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
---
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-10-30
03:47:24 UTC (rev 11070)
+++
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-10-30
06:23:57 UTC (rev 11071)
@@ -21,7 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.context;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.security.Principal;
import javax.annotation.Resource;
@@ -85,7 +87,7 @@
return "fail";
// Check standard jaxws properties
- InputSource wsdlSource =
(InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+ Object wsdl = msgContext.get(MessageContext.WSDL_DESCRIPTION);
QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
@@ -102,8 +104,21 @@
try
{
- Element root = DOMUtils.parse(wsdlSource);
- new DOMWriter(System.out).setPrettyprint(true).print(root);
+ Element root = null;
+ if (wsdl instanceof InputSource)
+ {
+ root = DOMUtils.parse((InputSource)wsdl);
+ }
+ else if (wsdl instanceof URI)
+ {
+ root = DOMUtils.parse(((URI)wsdl).toURL().openStream());
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ new DOMWriter(out).setPrettyprint(true).print(root);
+ if (!out.toString().contains("http://schemas.xmlsoap.org/wsdl/"))
+ {
+ throw new WebServiceException("Not a wsdl");
+ }
}
catch (IOException ex)
{
Modified:
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
---
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-10-30
03:47:24 UTC (rev 11070)
+++
framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-10-30
06:23:57 UTC (rev 11071)
@@ -21,7 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.context;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.security.Principal;
import javax.annotation.Resource;
@@ -61,7 +63,7 @@
return "fail";
// Check standard jaxws properties
- InputSource wsdlSource =
(InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+ Object wsdl = msgContext.get(MessageContext.WSDL_DESCRIPTION);
QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
@@ -76,10 +78,24 @@
if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context",
"testMessageContextProperties")))
throw new WebServiceException("Invalid qname: " + operation);
+
try
{
- Element root = DOMUtils.parse(wsdlSource);
- new DOMWriter(System.out).setPrettyprint(true).print(root);
+ Element root = null;
+ if (wsdl instanceof InputSource)
+ {
+ root = DOMUtils.parse((InputSource)wsdl);
+ }
+ else if (wsdl instanceof URI)
+ {
+ root = DOMUtils.parse(((URI)wsdl).toURL().openStream());
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ new DOMWriter(out).setPrettyprint(true).print(root);
+ if (!out.toString().contains("http://schemas.xmlsoap.org/wsdl/"))
+ {
+ throw new WebServiceException("Not a wsdl");
+ }
}
catch (IOException ex)
{
Show replies by date