Author: thomas.diesler(a)jboss.com
Date: 2007-07-24 09:25:49 -0400 (Tue, 24 Jul 2007)
New Revision: 3973
Removed:
trunk/integration/sunri/src/test/resources/test-excludes-jboss40.txt
trunk/integration/xfire/src/test/resources/test-excludes-jboss40.txt
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/ServerConfigFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ServletControllerExt.java
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java
trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml
trunk/integration/xfire/src/test/resources/test-excludes-jboss42.txt
trunk/integration/xfire/src/test/resources/test-excludes-jboss50.txt
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/ExampleSEI.java
Log:
More work on cxf integration
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -21,12 +21,16 @@
*/
package org.jboss.wsf.framework.deployment;
+//$Id$
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
-//$Id$
-
/**
* A deployer that assigns the endpoint address.
*
@@ -41,6 +45,14 @@
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
throw new IllegalStateException("Cannot obtain context root");
+
+ SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfigFactory spi = provider.getSPI(ServerConfigFactory.class);
+ ServerConfig serverConfig = spi.createServerConfig();
+
+ String host = serverConfig.getWebServiceHost();
+ int port = serverConfig.getWebServicePort();
+ String hostAndPort = host + (port > 0 ? ":" + port : "");
for (Endpoint ep : dep.getService().getEndpoints())
{
@@ -51,7 +63,7 @@
if (urlPattern.endsWith("/*"))
urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
- ep.setAddress(contextRoot + urlPattern);
+ ep.setAddress("http://" + hostAndPort + contextRoot + urlPattern);
}
}
}
\ No newline at end of file
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -25,8 +25,16 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.*;
-import org.jboss.wsf.spi.invocation.*;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.InvocationModelFactory;
+import org.jboss.wsf.spi.invocation.InvocationType;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.invocation.RequestHandlerFactory;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
@@ -39,29 +47,26 @@
*/
public class EndpointHandlerDeploymentAspect extends DeploymentAspect
{
- private String requestHandler;
- private LifecycleHandler lifecycleHandler;
-
private SPIProvider spiProvider;
public EndpointHandlerDeploymentAspect()
{
spiProvider = SPIProviderResolver.getInstance().getProvider();
- }
+ }
@Override
public void create(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
- // associate a request handler
+ // Associate a request handler
ep.setRequestHandler(getRequestHandler(dep));
- // associate a lifecycle handler
+ // Associate a lifecycle handler
ep.setLifecycleHandler(getLifecycleHandler(dep));
- // associate a n invocation handler
- // TODO: can this be null?
+ // Associate an invocation handler
+ // Invocation handlers are assigned per container or per stack
InvocationHandler invocationHandler = getInvocationHandler(ep);
if (invocationHandler != null)
ep.setInvocationHandler(invocationHandler);
@@ -94,9 +99,8 @@
}
}
-
InvocationType type = InvocationType.valueOf(key);
- InvocationHandler invocationHandler=
spiProvider.getSPI(InvocationModelFactory.class).createInvocationHandler( type );
+ InvocationHandler invocationHandler =
spiProvider.getSPI(InvocationModelFactory.class).createInvocationHandler(type);
return invocationHandler;
}
}
\ No newline at end of file
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/ServerConfigFactory.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/ServerConfigFactory.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/ServerConfigFactory.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -21,13 +21,10 @@
*/
package org.jboss.wsf.spi.management;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.logging.Logger;
-import org.jboss.ws.integration.KernelLocator;
+//$Id$
+
import org.jboss.wsf.spi.SPIView;
-// $Id$
-
/**
* Factory to container independent config
*
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -117,8 +117,12 @@
if (implVendor == null)
{
Service service = Service.create(new QName("dummyService"));
- service.addPort(new QName("dummyPort"),
SOAPBinding.SOAP11HTTP_BINDING, "http://dummy-address");
- Dispatch<Source> obj = service.createDispatch(new
QName("dummyPort"), Source.class, Mode.PAYLOAD);
+ Object obj = service.getHandlerResolver();
+ if (obj == null)
+ {
+ service.addPort(new QName("dummyPort"),
SOAPBinding.SOAP11HTTP_BINDING, "http://dummy-address");
+ obj = service.createDispatch(new QName("dummyPort"), Source.class,
Mode.PAYLOAD);
+ }
implVendor = obj.getClass().getPackage().getImplementationVendor();
implTitle = obj.getClass().getPackage().getImplementationTitle();
implVersion = obj.getClass().getPackage().getImplementationVersion();
Deleted: trunk/integration/sunri/src/test/resources/test-excludes-jboss40.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/test-excludes-jboss40.txt 2007-07-24
12:30:15 UTC (rev 3972)
+++ trunk/integration/sunri/src/test/resources/test-excludes-jboss40.txt 2007-07-24
13:25:49 UTC (rev 3973)
@@ -1,19 +0,0 @@
-#
-# $Id: test-excludes.txt 3907 2007-07-17 12:55:40Z thomas.diesler(a)jboss.com $
-#
-
-###################################################################
-# Exclude JBossWS-Native stuff
-#
-org/jboss/test/ws/jaxws/samples/wsaddressing/**
-org/jboss/test/ws/jaxws/samples/wseventing/**
-org/jboss/test/ws/jaxws/samples/wssecurity/**
-#
-###################################################################
-
-# [JBWS-1673] Fix JAXR samples for SunRI
-org/jboss/test/ws/jaxws/samples/jaxr/**
-
-# [JBWS-1674] Fix @WebServiceRef with SunRI
-org/jboss/test/ws/jaxws/samples/retail/**
-org/jboss/test/ws/jaxws/samples/webserviceref/**
Modified:
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ServletControllerExt.java
===================================================================
---
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ServletControllerExt.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ServletControllerExt.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -25,6 +25,9 @@
import java.io.IOException;
import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -64,20 +67,46 @@
{
try
{
- // JBossWS always uses the request URI
- EndpointInfo ei = new EndpointInfo();
- String address = req.getRequestURI();
-
- ei.setAddress(address);
- ServletDestination dest =
(ServletDestination)transport.getDestinationForPath(ei.getAddress());
+ // Find destination based on request URI
+ String requestURI = req.getRequestURI();
+ ServletDestination dest = null;
+ Collection<ServletDestination> destinations =
transport.getDestinations();
+ for (ServletDestination aux : destinations)
+ {
+ EndpointInfo ei = aux.getEndpointInfo();
+ String address = ei.getAddress();
+
+ // Fix invalid leading slash
+ if (address.startsWith("/http://"))
+ {
+ address = address.substring(1);
+ ei.setAddress(address);
+ }
+
+ String path = address;
+ try
+ {
+ path = new URL(address).getPath();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ if (requestURI.startsWith(path))
+ {
+ dest = aux;
+ break;
+ }
+ }
if (dest == null)
- throw new ServletException("Cannot obtain destination for: " +
address);
+ throw new ServletException("Cannot obtain destination for: " +
requestURI);
- ei = dest.getEndpointInfo();
+ EndpointInfo ei = dest.getEndpointInfo();
Bus bus = cxfServlet.getBus();
if (null != req.getQueryString() && req.getQueryString().length() > 0
&& bus.getExtension(QueryHandlerRegistry.class) != null)
{
- String ctxUri = address; //req.getPathInfo();
+ String ctxUri = requestURI; //req.getPathInfo();
String baseUri = req.getRequestURL().toString() + "?" +
req.getQueryString();
for (QueryHandler qh :
bus.getExtension(QueryHandlerRegistry.class).getHandlers())
Modified:
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java
===================================================================
---
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/metadata/services/DDEndpoint.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -59,7 +59,10 @@
public void writeTo(Writer writer) throws IOException
{
- writer.write("<jaxws:endpoint id='" + id + "'
address='"+ address +"' implementor='" + implementor +
"'>");
+ writer.write("<jaxws:endpoint id='" + id + "'");
+ writer.write(" address='" + address + "'");
+ writer.write(" implementor='" + implementor + "'");
+ writer.write(">");
//writer.write("<jaxws:implementor><bean class='" +
implementor + "'/></jaxws:implementor>");
// [JBWS-1746] Add support for configurable invoker in cxf.xml
@@ -81,8 +84,6 @@
StringBuilder str = new StringBuilder("Service");
str.append("\n id=" + id);
str.append("\n address=" + address);
- // str.append("\n invoker=" + invoker);
- str.append("\n serviceFactory=" + serviceFactory);
str.append("\n implementor=" + implementor);
return str.toString();
}
Modified: trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml
===================================================================
--- trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml 2007-07-24
12:30:15 UTC (rev 3972)
+++ trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml 2007-07-24
13:25:49 UTC (rev 3973)
@@ -23,7 +23,6 @@
</bean>
<!-- The registry for web service endpoints -->
- <!-- The registry for web service endpoints -->
<bean name="WSEndpointRegistry"
class="org.jboss.wsf.stack.xfire.ManagedEndpointRegistry"/>
<!--
Deleted: trunk/integration/xfire/src/test/resources/test-excludes-jboss40.txt
===================================================================
--- trunk/integration/xfire/src/test/resources/test-excludes-jboss40.txt 2007-07-24
12:30:15 UTC (rev 3972)
+++ trunk/integration/xfire/src/test/resources/test-excludes-jboss40.txt 2007-07-24
13:25:49 UTC (rev 3973)
@@ -1,50 +0,0 @@
-#
-# $Id: test-excludes.txt 3915 2007-07-17 16:16:05Z heiko.braun(a)jboss.com $
-#
-
-###################################################################
-# Exclude JBossWS-Native stuff
-#
-org/jboss/test/ws/jaxws/samples/wsaddressing/**
-org/jboss/test/ws/jaxws/samples/wseventing/**
-org/jboss/test/ws/jaxws/samples/wssecurity/**
-#
-###################################################################
-
-# [JBWS-1682] XFire does not generate proper service name
-org/jboss/test/ws/jaxws/samples/asynchronous/**
-org/jboss/test/ws/jaxws/samples/exception/**
-org/jboss/test/ws/jaxws/samples/handlerchain/**
-org/jboss/test/ws/jaxws/samples/oneway/**
-org/jboss/test/ws/jaxws/samples/soapbinding/**
-org/jboss/test/ws/jaxws/samples/webmethod/**
-org/jboss/test/ws/jaxws/samples/webservice/**
-org/jboss/test/ws/jaxws/samples/xop/**
-
-# [JBWS-1685] Add support for WebServiceContext propagation
-org/jboss/test/ws/jaxws/samples/context/**
-
-# [JBWS-1686] Add support for @Provider
-org/jboss/test/ws/jaxws/samples/httpbinding/**
-org/jboss/test/ws/jaxws/samples/provider/**
-
-# [JBWS-1683] Fix JAXR samples for XFire
-org/jboss/test/ws/jaxws/samples/jaxr/**
-
-# [JBWS-1687] Add support for @HandlerChain
-org/jboss/test/ws/jaxws/samples/logicalhandler/**
-
-# [JBWS-1684] Fix @WebServiceRef with XFire
-org/jboss/test/ws/jaxws/samples/retail/**
-org/jboss/test/ws/jaxws/samples/serviceref/**
-org/jboss/test/ws/jaxws/samples/webserviceref/**
-
-# ServiceRef Handling not yet implemented
-org/jboss/test/ws/jaxws/samples/serviceref/**
-
-# [JBWS-1689] Add support for SwaRef
-org/jboss/test/ws/jaxws/samples/swaref/**
-
-# [JBWS-1688] Fix @WebParam, @WebResult handling
-org/jboss/test/ws/jaxws/samples/webparam/**
-org/jboss/test/ws/jaxws/samples/webresult/**
Modified: trunk/integration/xfire/src/test/resources/test-excludes-jboss42.txt
===================================================================
--- trunk/integration/xfire/src/test/resources/test-excludes-jboss42.txt 2007-07-24
12:30:15 UTC (rev 3972)
+++ trunk/integration/xfire/src/test/resources/test-excludes-jboss42.txt 2007-07-24
13:25:49 UTC (rev 3973)
@@ -11,40 +11,46 @@
#
###################################################################
-# [JBWS-1682] XFire does not generate proper service name
-org/jboss/test/ws/jaxws/samples/asynchronous/**
+# [JBWS-1746] Add support for configurable invoker in cxf.xml
+org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.*
+org/jboss/test/ws/jaxws/samples/webservice/WebServiceEJB3TestCase.*
+org/jboss/test/ws/jaxws/samples/swaref/**
+
+# [JBWS-1750] Investigate CXF exception handling
org/jboss/test/ws/jaxws/samples/exception/**
+
+# [JBWS-1751] Investigate CXF samples handlerchain
org/jboss/test/ws/jaxws/samples/handlerchain/**
-org/jboss/test/ws/jaxws/samples/oneway/**
-org/jboss/test/ws/jaxws/samples/soapbinding/**
-org/jboss/test/ws/jaxws/samples/webmethod/**
-org/jboss/test/ws/jaxws/samples/webservice/**
-org/jboss/test/ws/jaxws/samples/xop/**
-# [JBWS-1685] Add support for WebServiceContext propagation
-org/jboss/test/ws/jaxws/samples/context/**
-
-# [JBWS-1686] Add support for @Provider
+# [JBWS-1752] Investigate CXF samples httpbinding
org/jboss/test/ws/jaxws/samples/httpbinding/**
-org/jboss/test/ws/jaxws/samples/provider/**
# [JBWS-1683] Fix JAXR samples for XFire
org/jboss/test/ws/jaxws/samples/jaxr/**
-# [JBWS-1687] Add support for @HandlerChain
+# [JBWS-1753] Investigate CXF samples logicalhandler
org/jboss/test/ws/jaxws/samples/logicalhandler/**
-# [JBWS-1684] Fix @WebServiceRef with XFire
+# [JBWS-1754] Investigate CXF samples oneway
+org/jboss/test/ws/jaxws/samples/oneway/**
+
+# [JBWS-1755] Investigate CXF samples provider
+org/jboss/test/ws/jaxws/samples/provider/**
+
+# [JBWS-1756] Fix @WebServiceRef with CXF
org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/serviceref/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
-# ServiceRef Handling not yet implemented
-org/jboss/test/ws/jaxws/samples/serviceref/**
+# [JBWS-1757] Investigate CXF samples soapbinding
+org/jboss/test/ws/jaxws/samples/soapbinding/**
-# [JBWS-1689] Add support for SwaRef
-org/jboss/test/ws/jaxws/samples/swaref/**
+# [JBWS-1758] Investigate CXF samples webmethod
+org/jboss/test/ws/jaxws/samples/webmethod/**
-# [JBWS-1688] Fix @WebParam, @WebResult handling
-org/jboss/test/ws/jaxws/samples/webparam/**
-org/jboss/test/ws/jaxws/samples/webresult/**
+# [JBWS-1759] Investigate CXF samples webservice
+org/jboss/test/ws/jaxws/samples/webservice/**
+
+# [JBWS-1759] Investigate CXF samples xop
+org/jboss/test/ws/jaxws/samples/xop/**
+
Modified: trunk/integration/xfire/src/test/resources/test-excludes-jboss50.txt
===================================================================
--- trunk/integration/xfire/src/test/resources/test-excludes-jboss50.txt 2007-07-24
12:30:15 UTC (rev 3972)
+++ trunk/integration/xfire/src/test/resources/test-excludes-jboss50.txt 2007-07-24
13:25:49 UTC (rev 3973)
@@ -11,40 +11,46 @@
#
###################################################################
-# [JBWS-1682] XFire does not generate proper service name
-org/jboss/test/ws/jaxws/samples/asynchronous/**
+# [JBWS-1746] Add support for configurable invoker in cxf.xml
+org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.*
+org/jboss/test/ws/jaxws/samples/webservice/WebServiceEJB3TestCase.*
+org/jboss/test/ws/jaxws/samples/swaref/**
+
+# [JBWS-1750] Investigate CXF exception handling
org/jboss/test/ws/jaxws/samples/exception/**
+
+# [JBWS-1751] Investigate CXF samples handlerchain
org/jboss/test/ws/jaxws/samples/handlerchain/**
-org/jboss/test/ws/jaxws/samples/oneway/**
-org/jboss/test/ws/jaxws/samples/soapbinding/**
-org/jboss/test/ws/jaxws/samples/webmethod/**
-org/jboss/test/ws/jaxws/samples/webservice/**
-org/jboss/test/ws/jaxws/samples/xop/**
-# [JBWS-1685] Add support for WebServiceContext propagation
-org/jboss/test/ws/jaxws/samples/context/**
-
-# [JBWS-1686] Add support for @Provider
+# [JBWS-1752] Investigate CXF samples httpbinding
org/jboss/test/ws/jaxws/samples/httpbinding/**
-org/jboss/test/ws/jaxws/samples/provider/**
# [JBWS-1683] Fix JAXR samples for XFire
org/jboss/test/ws/jaxws/samples/jaxr/**
-# [JBWS-1687] Add support for @HandlerChain
+# [JBWS-1753] Investigate CXF samples logicalhandler
org/jboss/test/ws/jaxws/samples/logicalhandler/**
-# [JBWS-1684] Fix @WebServiceRef with XFire
+# [JBWS-1754] Investigate CXF samples oneway
+org/jboss/test/ws/jaxws/samples/oneway/**
+
+# [JBWS-1755] Investigate CXF samples provider
+org/jboss/test/ws/jaxws/samples/provider/**
+
+# [JBWS-1756] Fix @WebServiceRef with CXF
org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/serviceref/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
-# ServiceRef Handling not yet implemented
-org/jboss/test/ws/jaxws/samples/serviceref/**
+# [JBWS-1757] Investigate CXF samples soapbinding
+org/jboss/test/ws/jaxws/samples/soapbinding/**
-# [JBWS-1689] Add support for SwaRef
-org/jboss/test/ws/jaxws/samples/swaref/**
+# [JBWS-1758] Investigate CXF samples webmethod
+org/jboss/test/ws/jaxws/samples/webmethod/**
-# [JBWS-1688] Fix @WebParam, @WebResult handling
-org/jboss/test/ws/jaxws/samples/webparam/**
-org/jboss/test/ws/jaxws/samples/webresult/**
+# [JBWS-1759] Investigate CXF samples webservice
+org/jboss/test/ws/jaxws/samples/webservice/**
+
+# [JBWS-1759] Investigate CXF samples xop
+org/jboss/test/ws/jaxws/samples/xop/**
+
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/asynchronous/AsynchronousDispatchTestCase.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -23,6 +23,7 @@
// $Id$
+import java.io.IOException;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
@@ -43,6 +44,8 @@
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.w3c.dom.Element;
/**
* Test JAXWS asynchrous dispatch
@@ -67,8 +70,7 @@
{
Source reqObj = new StreamSource(new StringReader(reqPayload));
Response response = createDispatch().invokeAsync(reqObj);
- Source result = (Source)response.get(1000, TimeUnit.MILLISECONDS);
- assertEquals(DOMUtils.parse(expPayload), DOMUtils.sourceToElement(result));
+ verifyResponse((Source)response.get(3000, TimeUnit.MILLISECONDS));
}
public void testInvokeAsynchHandler() throws Exception
@@ -79,8 +81,7 @@
{
try
{
- Source result = (Source)response.get();
- assertEquals(DOMUtils.parse(expPayload),
DOMUtils.sourceToElement(result));
+ verifyResponse((Source)response.get());
asyncHandlerCalled = true;
}
catch (Exception ex)
@@ -108,4 +109,11 @@
Dispatch dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
return dispatch;
}
+
+ private void verifyResponse(Source result) throws IOException
+ {
+ Element resElement = DOMUtils.sourceToElement(result);
+ String resStr = DOMWriter.printNode(resElement, false);
+ assertTrue("Unexpected response: " + resStr,
resStr.contains("<result>Hello</result>"));
+ }
}
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/ExampleSEI.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/ExampleSEI.java 2007-07-24
12:30:15 UTC (rev 3972)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/soapbinding/ExampleSEI.java 2007-07-24
13:25:49 UTC (rev 3973)
@@ -21,15 +21,12 @@
*/
package org.jboss.test.ws.jaxws.samples.soapbinding;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService(name = "Example")
@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
-public interface ExampleSEI extends Remote
+public interface ExampleSEI
{
- String concat(String first, String second, String third) throws RemoteException;
+ String concat(String first, String second, String third);
}