Author: alessio.soldano(a)jboss.com
Date: 2011-07-21 06:33:48 -0400 (Thu, 21 Jul 2011)
New Revision: 14728
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
Removed:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
Log:
[AS7-1322] Adding testcase
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2011-07-21
09:53:08 UTC (rev 14727)
+++
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2011-07-21
10:33:48 UTC (rev 14728)
@@ -482,6 +482,14 @@
<exclude
name="org/jboss/test/ws/jaxws/samples/xop/doclit/*TestCase.class"/>
</classes>
</war>
+
+ <!-- endpoint-publish.war -->
+ <war warfile="${tests.output.dir}/test-libs/endpoint-publish.war"
needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/publish/**"/>
+ <exclude name="org/jboss/test/ws/publish/*TestCase.class"/>
+ </classes>
+ </war>
<!-- management-recording.jar -->
<jar
destfile="${tests.output.dir}/test-libs/management-recording-native.jar">
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java
===================================================================
---
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java 2011-07-19
14:38:40 UTC (rev 14705)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.publish;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-@WebService (name="Endpoint")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface Endpoint
-{
- @WebMethod(operationName = "echoString", action =
"urn:EchoString")
- String echo(String input);
-}
Copied:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java
(from rev 14705,
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java)
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/Endpoint.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.publish;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService (name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint
+{
+ @WebMethod(operationName = "echoString", action =
"urn:EchoString")
+ String echo(String input);
+}
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java
===================================================================
---
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java 2011-07-19
14:38:40 UTC (rev 14705)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.publish;
-
-import javax.annotation.Resource;
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-
-@WebService(serviceName="EndpointService", portName="EndpointPort",
endpointInterface = "org.jboss.test.ws.publish.Endpoint")
-public class EndpointImpl
-{
- @Resource
- WebServiceContext wsCtx;
-
- // Provide logging
- private static Logger log = Logger.getLogger(EndpointImpl.class);
-
- public String echo(String input)
- {
- log.info("echo: " + input);
- MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
- if (msgContext == null) {
- return "MessageContext is null!";
- }
- log.info("WSDL_DESCRIPTION: " +
msgContext.get(MessageContext.WSDL_DESCRIPTION));
- log.info("WSDL_SERVICE: " +
msgContext.get(MessageContext.WSDL_SERVICE));
- log.info("WSDL_INTERFACE: " +
msgContext.get(MessageContext.WSDL_INTERFACE));
- log.info("WSDL_PORT: " + msgContext.get(MessageContext.WSDL_PORT));
- log.info("WSDL_OPERATION: " +
msgContext.get(MessageContext.WSDL_OPERATION));
- return input;
- }
-}
Copied:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java
(from rev 14705,
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java)
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.publish;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.logging.Logger;
+
+@WebService(serviceName="EndpointService", portName="EndpointPort",
endpointInterface = "org.jboss.test.ws.publish.Endpoint")
+public class EndpointImpl
+{
+ @Resource
+ WebServiceContext wsCtx;
+
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public String echo(String input)
+ {
+ log.info("echo: " + input);
+ MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+ if (msgContext == null) {
+ return "MessageContext is null!";
+ }
+ log.info("WSDL_DESCRIPTION: " +
msgContext.get(MessageContext.WSDL_DESCRIPTION));
+ log.info("WSDL_SERVICE: " +
msgContext.get(MessageContext.WSDL_SERVICE));
+ log.info("WSDL_INTERFACE: " +
msgContext.get(MessageContext.WSDL_INTERFACE));
+ log.info("WSDL_PORT: " + msgContext.get(MessageContext.WSDL_PORT));
+ log.info("WSDL_OPERATION: " +
msgContext.get(MessageContext.WSDL_OPERATION));
+ return input;
+ }
+}
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
===================================================================
---
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java 2011-07-19
14:38:40 UTC (rev 14705)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.publish;
-
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-
-@WebService(serviceName="EndpointService", portName="EndpointPort",
endpointInterface = "org.jboss.test.ws.publish.Endpoint")
-public class EndpointImpl2
-{
- // Provide logging
- private static Logger log = Logger.getLogger(EndpointImpl2.class);
-
- public String echo(String input)
- {
- log.info("echo (2): " + input);
- return input;
- }
-}
Copied:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
(from rev 14705,
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java)
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.publish;
+
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+@WebService(serviceName="EndpointService", portName="EndpointPort",
endpointInterface = "org.jboss.test.ws.publish.Endpoint")
+public class EndpointImpl2
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl2.class);
+
+ public String echo(String input)
+ {
+ log.info("echo (2): " + input);
+ return input;
+ }
+}
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
===================================================================
---
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2011-07-19
14:38:40 UTC (rev 14705)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.publish;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-
-import javax.servlet.ServletException;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.publish.Context;
-import org.jboss.wsf.spi.publish.EndpointPublisher;
-import org.jboss.wsf.spi.publish.EndpointPublisherFactory;
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- * @since 01-Apr-2011
- *
- */
-@WebServlet(name = "EndpointPublishServlet", urlPatterns = "/*")
-public class EndpointPublishServlet extends HttpServlet
-{
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- Context ctx = null;
- EndpointPublisher publisher = null;
- try
- {
- //deploy endpoints
- ClassLoader loader =
ClassLoaderProvider.getDefaultProvider().getWebServiceSubsystemClassLoader();
- EndpointPublisherFactory factory =
ServiceLoader.load(EndpointPublisherFactory.class, loader).iterator().next();
- publisher = factory.newEndpointPublisher("default-host");
-
- Map<String,String> map = new HashMap<String, String>();
- map.put("/pattern",
"org.jboss.test.ws.publish.EndpointImpl");
- map.put("/pattern2",
"org.jboss.test.ws.publish.EndpointImpl2");
-
- ctx = publisher.publish("ep-publish-test",
Thread.currentThread().getContextClassLoader(), map);
- for (Endpoint ep : ctx.getEndpoints()) {
- System.out.println("State: " + ep.getState());
- System.out.println("Address: " + ep.getAddress());
- System.out.println("TargetBeanClass: " + ep.getTargetBeanClass());
- }
-
- //call endpoint
- invoke(new
URL("http://localhost:8080/ep-publish-test/pattern?wsdl"));
- invoke(new
URL("http://localhost:8080/ep-publish-test/pattern2?wsdl"));
-
- res.getWriter().print("1");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- res.getWriter().print(e.getMessage());
- }
- finally
- {
- if (ctx != null && publisher != null)
- {
- try
- {
- //undeploy endpoints
- publisher.destroy(ctx);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- res.getWriter().print(e.getMessage());
- }
- }
- }
- }
-
- private static void invoke(URL wsdlURL) throws Exception {
- QName serviceName = new
QName("http://publish.ws.test.jboss.org/",
"EndpointService");
- Service service = Service.create(wsdlURL, serviceName);
- org.jboss.test.ws.publish.Endpoint port =
service.getPort(org.jboss.test.ws.publish.Endpoint.class);
- String result = port.echo("Foo");
- if (!"Foo".equals(result))
- {
- throw new Exception("Expected 'Foo' but got '" + result +
"'");
- }
- }
-}
Copied:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
(from rev 14705,
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java)
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.publish;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.publish.Context;
+import org.jboss.wsf.spi.publish.EndpointPublisher;
+import org.jboss.wsf.spi.publish.EndpointPublisherFactory;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Apr-2011
+ *
+ */
+@WebServlet(name = "EndpointPublishServlet", urlPatterns = "/*")
+public class EndpointPublishServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ Context ctx = null;
+ EndpointPublisher publisher = null;
+ try
+ {
+ //deploy endpoints
+ ClassLoader loader =
ClassLoaderProvider.getDefaultProvider().getWebServiceSubsystemClassLoader();
+ EndpointPublisherFactory factory =
ServiceLoader.load(EndpointPublisherFactory.class, loader).iterator().next();
+ publisher = factory.newEndpointPublisher("default-host");
+
+ Map<String,String> map = new HashMap<String, String>();
+ map.put("/pattern",
"org.jboss.test.ws.publish.EndpointImpl");
+ map.put("/pattern2",
"org.jboss.test.ws.publish.EndpointImpl2");
+
+ ctx = publisher.publish("ep-publish-test",
Thread.currentThread().getContextClassLoader(), map);
+ for (Endpoint ep : ctx.getEndpoints()) {
+ System.out.println("State: " + ep.getState());
+ System.out.println("Address: " + ep.getAddress());
+ System.out.println("TargetBeanClass: " + ep.getTargetBeanClass());
+ }
+
+ //call endpoint
+ invoke(new
URL("http://localhost:8080/ep-publish-test/pattern?wsdl"));
+ invoke(new
URL("http://localhost:8080/ep-publish-test/pattern2?wsdl"));
+
+ res.getWriter().print("1");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ res.getWriter().print(e.getMessage());
+ }
+ finally
+ {
+ if (ctx != null && publisher != null)
+ {
+ try
+ {
+ //undeploy endpoints
+ publisher.destroy(ctx);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ res.getWriter().print(e.getMessage());
+ }
+ }
+ }
+ }
+
+ private static void invoke(URL wsdlURL) throws Exception {
+ QName serviceName = new
QName("http://publish.ws.test.jboss.org/",
"EndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ org.jboss.test.ws.publish.Endpoint port =
service.getPort(org.jboss.test.ws.publish.Endpoint.class);
+ String result = port.echo("Foo");
+ if (!"Foo".equals(result))
+ {
+ throw new Exception("Expected 'Foo' but got '" + result +
"'");
+ }
+ }
+}
Deleted:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
===================================================================
---
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java 2011-07-19
14:38:40 UTC (rev 14705)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, 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.publish;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * Test WS endpoint publish api to JBoss AS container
- *
- * @author alessio.soldano(a)jboss.com
- * @since 13-Jul-2011
- */
-public class EndpointPublishTestCase extends JBossWSTest
-{
- public static Test suite()
- {
- return new JBossWSTestSetup(EndpointPublishTestCase.class,
"endpoint-publish.war");
- }
-
- public void testEndpointPublish() throws Exception
- {
- URL url = new URL("http://" + getServerHost() +
":8080/endpoint-publish");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("1", br.readLine());
- }
-}
Copied:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
(from rev 14705,
shared-testsuite/branches/asoldano/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java)
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishTestCase.java 2011-07-21
10:33:48 UTC (rev 14728)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.publish;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test WS endpoint publish api to JBoss AS container
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 13-Jul-2011
+ */
+public class EndpointPublishTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(EndpointPublishTestCase.class,
"endpoint-publish.war");
+ }
+
+ public void testEndpointPublish() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() +
":8080/endpoint-publish");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("1", br.readLine());
+ }
+}