Author: alessio.soldano(a)jboss.com
Date: 2009-06-30 05:12:54 -0400 (Tue, 30 Jun 2009)
New Revision: 10255
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointBean.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointInterface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointTestCase.java
Log:
[JBWS-2112] Adding an Endpoint API testcase with CXF. This does not use the jbossws-spi
endpoint api, just the jaxws defined api (and CXF brings up a Jetty server instnace on the
fly)
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointBean.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointBean.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointBean.java 2009-06-30
09:12:54 UTC (rev 10255)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.cxf.endpoint;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint deployment
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-Apr-2005
+ */
+@WebService
+(
+ serviceName = "EndpointService",
+ endpointInterface =
"org.jboss.test.ws.jaxws.cxf.endpoint.EndpointInterface",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/endpoint"
+)
+public class EndpointBean implements EndpointInterface
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointInterface.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointInterface.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointInterface.java 2009-06-30
09:12:54 UTC (rev 10255)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.cxf.endpoint;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * Test the JSR-181 annotation: javax.jws.WebService
+ * This interface is only used in the client deployment.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-Apr-2005
+ */
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointInterface extends Remote
+{
+ String echo(String input) throws RemoteException;
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointInterface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointTestCase.java 2009-06-30
09:12:54 UTC (rev 10255)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.cxf.endpoint;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Test JAXWS Endpoint deployment in a JSE environment
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 30-Jun-2009
+ */
+public class EndpointTestCase extends JBossWSTest
+{
+ private static final int port = 8878;
+
+ public void testJSEEndpointPublish() throws Exception
+ {
+ EndpointBean epImpl = new EndpointBean();
+ Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl);
+ String publishURL = "http://" + getServerHost() + ":" + port +
"/jaxws-endpoint";
+ endpoint.publish(publishURL);
+
+ URL wsdlURL = new URL(publishURL + "?wsdl");
+ QName qname = new QName("http://org.jboss.ws/jaxws/cxf/endpoint",
"EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ EndpointInterface port =
(EndpointInterface)service.getPort(EndpointInterface.class);
+
+ // Invoke the endpoint
+ String helloWorld = "Hello world!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+
+ endpoint.stop();
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endpoint/EndpointTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF