Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 09:22:43 -0400 (Tue, 04 Aug 2009)
New Revision: 10481
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
Log:
[JBWS-2203] Fixing testcase
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-08-04
13:18:57 UTC (rev 10480)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-08-04
13:22:43 UTC (rev 10481)
@@ -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/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-08-04
13:18:57 UTC (rev 10480)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-08-04
13:22:43 UTC (rev 10481)
@@ -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,15 +78,30 @@
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)
{
throw new WebServiceException("Cannot parse
MessageContext.WSDL_DESCRIPTION", ex);
}
+
return "pass";
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2009-08-04
13:18:57 UTC (rev 10480)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2009-08-04
13:22:43 UTC (rev 10481)
@@ -77,12 +77,6 @@
return;
}
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [JBWS-2203] Implement CXF standard message
context properties");
- return;
- }
-
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2009-08-04
13:18:57 UTC (rev 10480)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2009-08-04
13:22:43 UTC (rev 10481)
@@ -76,12 +76,6 @@
return;
}
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [JBWS-2203] Implement CXF standard message
context properties");
- return;
- }
-
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
Show replies by date