Author: alessio.soldano(a)jboss.com
Date: 2009-09-29 12:25:45 -0400 (Tue, 29 Sep 2009)
New Revision: 10792
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
Log:
[JBPAPP-2824] Fixing test
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
---
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-09-29
15:46:46 UTC (rev 10791)
+++
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-09-29
16:25:45 UTC (rev 10792)
@@ -23,7 +23,9 @@
// $Id$
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.security.Principal;
import javax.annotation.Resource;
@@ -73,7 +75,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);
@@ -90,7 +92,16 @@
try
{
- Element root = DOMUtils.parse(wsdlSource);
+ 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(System.out).setPrettyprint(true).print(root);
}
catch (IOException ex)
Modified:
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
---
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-09-29
15:46:46 UTC (rev 10791)
+++
framework/branches/jbossws-framework-2.0.1.GA_CP/src/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-09-29
16:25:45 UTC (rev 10792)
@@ -23,7 +23,9 @@
// $Id: $
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.security.Principal;
import javax.annotation.Resource;
@@ -63,7 +65,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);
@@ -80,7 +82,16 @@
try
{
- Element root = DOMUtils.parse(wsdlSource);
+ 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(System.out).setPrettyprint(true).print(root);
}
catch (IOException ex)