[jboss-svn-commits] JBossWS SVN: r971 - in branches/tdiesler/trunk/src/test: java/org/jboss/test/ws/jaxws/asynchronous resources/jaxws/asynchronous/WEB-INF resources/jaxws/asynchronous/WEB-INF/wsdl resources/jaxws/logicalhandler/META-INF/wsdl
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Sep 15 14:43:28 EDT 2006
Author: thomas.diesler at jboss.com
Date: 2006-09-15 14:43:23 -0400 (Fri, 15 Sep 2006)
New Revision: 971
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/TestEndpoint.java
branches/tdiesler/trunk/src/test/resources/jaxws/asynchronous/WEB-INF/wsdl/
branches/tdiesler/trunk/src/test/resources/jaxws/asynchronous/WEB-INF/wsdl/TestService.wsdl
Modified:
branches/tdiesler/trunk/src/test/resources/jaxws/logicalhandler/META-INF/wsdl/TestService.wsdl
Log:
partial commit
Added: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java 2006-09-15 17:04:36 UTC (rev 970)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java 2006-09-15 18:43:23 UTC (rev 971)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.asynchronous;
+
+// $Id: $
+
+import java.io.StringReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.utils.DOMUtils;
+import org.xml.sax.InputSource;
+
+/**
+ * Test JAXWS asynchrous proxy
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-Aug-2006
+ */
+public class AsynchronousProxyTestCase extends JBossWSTest
+{
+ private String targetNS = "http://org.jboss.ws/jaxws/asynchronous";
+ private Exception handlerException;
+ private boolean asyncHandlerCalled;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(AsynchronousProxyTestCase.class, "jaxws-asynchronous.war");
+ }
+
+ public void testInvokeSynch() throws Exception
+ {
+ TestEndpoint port = createProxy();
+ String retStr = port.echo("Hello");
+ assertEquals("Hello", retStr);
+ }
+
+/*
+ public void testInvokeAsynch() throws Exception
+ {
+ StreamSource reqObj = new StreamSource(new StringReader(reqPayload));
+ Response response = createDispatch().invokeAsync(reqObj);
+ StreamSource result = (StreamSource)response.get(1000, TimeUnit.MILLISECONDS);
+ InputSource inputSource = new InputSource(result.getReader());
+ assertEquals(DOMUtils.parse(expPayload), DOMUtils.parse(inputSource));
+ }
+
+ public void testInvokeAsynchHandler() throws Exception
+ {
+ AsyncHandler handler = new AsyncHandler()
+ {
+ public void handleResponse(Response response)
+ {
+ try
+ {
+ StreamSource result = (StreamSource)response.get();
+ InputSource inputSource = new InputSource(result.getReader());
+ assertEquals(DOMUtils.parse(expPayload), DOMUtils.parse(inputSource));
+ asyncHandlerCalled = true;
+ }
+ catch (Exception ex)
+ {
+ handlerException = ex;
+ }
+ }
+ };
+ StreamSource reqObj = new StreamSource(new StringReader(reqPayload));
+ Future future = createDispatch().invokeAsync(reqObj, handler);
+ future.get(1000, TimeUnit.MILLISECONDS);
+
+ if (handlerException != null)
+ throw handlerException;
+
+ assertTrue("Async handler called", asyncHandlerCalled);
+ }
+*/
+ private TestEndpoint createProxy() throws MalformedURLException
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-asynchronous?wsdl");
+ QName serviceName = new QName(targetNS, "TestEndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ return (TestEndpoint)service.getPort(TestEndpoint.class);
+ }
+}
Property changes on: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/AsynchronousProxyTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/TestEndpoint.java
===================================================================
--- branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/TestEndpoint.java 2006-09-15 17:04:36 UTC (rev 970)
+++ branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/TestEndpoint.java 2006-09-15 18:43:23 UTC (rev 971)
@@ -0,0 +1,37 @@
+package org.jboss.test.ws.jaxws.asynchronous;
+
+import java.util.concurrent.Future;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b59-fcs
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/asynchronous")
+ at SOAPBinding(style = Style.RPC)
+public interface TestEndpoint
+{
+ @WebMethod(operationName = "echo")
+ public Response<String> echoAsync(@WebParam(name = "String_1", partName = "String_1")
+ String string1);
+
+ @WebMethod(operationName = "echo")
+ public Future<?> echoAsync(@WebParam(name = "String_1", partName = "String_1")
+ String string1, @WebParam(name = "asyncHandler", partName = "asyncHandler")
+ AsyncHandler<String> asyncHandler);
+
+ @WebMethod
+ @WebResult(name = "result", partName = "result")
+ public String echo(@WebParam(name = "String_1", partName = "String_1")
+ String string1);
+
+}
Property changes on: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/asynchronous/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/tdiesler/trunk/src/test/resources/jaxws/asynchronous/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- branches/tdiesler/trunk/src/test/resources/jaxws/asynchronous/WEB-INF/wsdl/TestService.wsdl 2006-09-15 17:04:36 UTC (rev 970)
+++ branches/tdiesler/trunk/src/test/resources/jaxws/asynchronous/WEB-INF/wsdl/TestService.wsdl 2006-09-15 18:43:23 UTC (rev 971)
@@ -0,0 +1,46 @@
+<!--
+ This wsdl is only used for client artifact generation
+
+ wsimport -keep -verbose -d ../../../java ./WEB-INF/wsdl/TestService.wsdl
+
+ $Id: $
+-->
+<definitions name='TestEndpointService' targetNamespace='http://org.jboss.ws/jaxws/asynchronous' xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/jaxws/asynchronous' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
+
+ <jaxws:bindings>
+ <jaxws:package name="org.jboss.test.ws.jaxws.asynchronous"/>
+ <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
+ </jaxws:bindings>
+
+ <message name='TestEndpoint_echoResponse'>
+ <part name='result' type='xsd:string'/>
+ </message>
+ <message name='TestEndpoint_echo'>
+ <part name='String_1' type='xsd:string'/>
+ </message>
+ <portType name='TestEndpoint'>
+ <operation name='echo' parameterOrder='String_1'>
+ <input message='tns:TestEndpoint_echo'/>
+ <output message='tns:TestEndpoint_echoResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/jaxws/asynchronous' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/jaxws/asynchronous' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestEndpointService'>
+ <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
+ <soap:address location='http://tdvaio:8080/jaxws-asynchronous/TestEndpoint'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/tdiesler/trunk/src/test/resources/jaxws/asynchronous/WEB-INF/wsdl/TestService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/tdiesler/trunk/src/test/resources/jaxws/logicalhandler/META-INF/wsdl/TestService.wsdl
===================================================================
--- branches/tdiesler/trunk/src/test/resources/jaxws/logicalhandler/META-INF/wsdl/TestService.wsdl 2006-09-15 17:04:36 UTC (rev 970)
+++ branches/tdiesler/trunk/src/test/resources/jaxws/logicalhandler/META-INF/wsdl/TestService.wsdl 2006-09-15 18:43:23 UTC (rev 971)
@@ -1,10 +1,10 @@
-
<!--
This wsdl is only used for client artifact generation
wsimport -keep -verbose -d ../../../../java ./wsdl/TestService.wsdl
+
+ $Id: $
-->
-
<definitions name='SOAPEndpointService' targetNamespace='http://org.jboss.ws/jaxws/logicalhandler' xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/jaxws/logicalhandler' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
More information about the jboss-svn-commits
mailing list