[jbossws-commits] JBossWS SVN: r11066 - in framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test: java/org/jboss/test/ws/jaxws and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Oct 29 09:14:53 EDT 2009


Author: richard.opalka at jboss.com
Date: 2009-10-29 09:14:52 -0400 (Thu, 29 Oct 2009)
New Revision: 11066

Added:
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/Endpoint.java
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/EndpointImpl.java
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/JBWS2630TestCase.java
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/resources/jaxws/jbws2630/
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/resources/jaxws/jbws2630/WEB-INF/
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/resources/jaxws/jbws2630/WEB-INF/web.xml
Modified:
   framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBPAPP-3002] backporting test suite

Modified: framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/ant-import/build-jars-jaxws.xml	2009-10-29 08:11:52 UTC (rev 11065)
+++ framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/ant-import/build-jars-jaxws.xml	2009-10-29 13:14:52 UTC (rev 11066)
@@ -729,6 +729,18 @@
       </webinf>
     </war>
 
+    <!-- jaxws-jbws2630 -->
+    <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2630-service.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2630/WEB-INF/web.xml">
+      <classes dir="${tests.output.dir}/test-classes">
+      	<include name="org/jboss/test/ws/jaxws/jbws2630/Endpoint*.class"/>
+      </classes>
+    </war>
+    <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2630.jar">
+      <fileset dir="${tests.output.dir}/test-libs">
+        <include name="jaxws-jbws2630-service.war"/>
+      </fileset>
+    </jar>
+
     <!-- jaxws-jbws2634 -->
     <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2634.jar">
       <fileset dir="${tests.output.dir}/test-classes">

Added: framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/Endpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/Endpoint.java	                        (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/Endpoint.java	2009-10-29 13:14:52 UTC (rev 11066)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2630;
+
+import java.rmi.Remote;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 05-Aug-2009
+ */
+ at WebService(targetNamespace = "http://org.jboss/test/ws/jbws2630")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint extends Remote
+{
+
+   @WebMethod
+   public String echo(String s);
+
+}

Added: framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/EndpointImpl.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/EndpointImpl.java	                        (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/EndpointImpl.java	2009-10-29 13:14:52 UTC (rev 11066)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2630;
+
+import javax.jws.WebService;
+
+/**
+*
+* @author alessio.soldano at jboss.com
+* @since 05-Aug-2009
+*/
+ at WebService(serviceName = "EndpointService", targetNamespace = "http://org.jboss/test/ws/jbws2630", endpointInterface = "org.jboss.test.ws.jaxws.jbws2630.Endpoint")
+public class EndpointImpl implements Endpoint
+{
+   public String echo(String s)
+   {
+      return s;
+   }
+}

Added: framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/JBWS2630TestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/JBWS2630TestCase.java	                        (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2630/JBWS2630TestCase.java	2009-10-29 13:14:52 UTC (rev 11066)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2630;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2630]
+ * 
+ * Tests a valid endpoint address is shown in context servlet when
+ * deploying a jar file containing a war file with the endpoint.
+ * 
+ * @author alessio.soldano at jboss.com
+ * @since 05-Aug-2009
+ */
+public class JBWS2630TestCase extends JBossWSTest
+{
+   private String endpointAddress = "http://" + this.getServerHost() + ":8080/jaxws-jbws2630-jaxws-jbws2630-service/Endpoint";
+
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(JBWS2630TestCase.class, "jaxws-jbws2630.jar");
+   }
+   
+   public void testJMXConsole() throws Exception
+   {
+      MBeanServerConnection server = getServer();
+      ObjectName oname = new ObjectName("jboss.ws:context=jaxws-jbws2630-jaxws-jbws2630-service,endpoint=Endpoint");
+      /* @Address attribute not available in EAP5
+      String address = (String)server.getAttribute(oname, "Address");
+      assertEquals(new URL(endpointAddress).getPath(), new URL(address).getPath());
+      */
+      assertNotNull(server.getAttribute(oname, "StartTime"));
+   }
+   
+   public void testWSDL() throws Exception
+   {
+      URL wsdlURL = new URL(endpointAddress + "?wsdl");
+      Definition wsdl = getWSDLDefinition(wsdlURL.toExternalForm());
+
+      assertNotNull("Unable to get WSDL", wsdl);
+   }
+   
+   public void testEndpoint() throws Exception
+   {
+      URL url = new URL(endpointAddress + "?wsdl");
+      QName serviceName = new QName("http://org.jboss/test/ws/jbws2630", "EndpointService");
+      Service service = Service.create(url, serviceName);
+      Endpoint port = service.getPort(Endpoint.class);
+      String s = "Hi";
+      assertEquals(s, port.echo(s));
+   }
+
+   private Definition getWSDLDefinition(String wsdlLocation) throws Exception
+   {
+      WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+      WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+
+      Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
+      return definition;
+   }
+
+}

Added: framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/resources/jaxws/jbws2630/WEB-INF/web.xml
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/resources/jaxws/jbws2630/WEB-INF/web.xml	                        (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP5/testsuite/test/resources/jaxws/jbws2630/WEB-INF/web.xml	2009-10-29 13:14:52 UTC (rev 11066)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+  <servlet>
+    <servlet-name>Endpoint</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.jbws2630.EndpointImpl</servlet-class>
+  </servlet>
+ 
+  <servlet-mapping>
+    <servlet-name>Endpoint</servlet-name>
+    <url-pattern>/Endpoint</url-pattern>
+  </servlet-mapping>
+  
+</web-app>
\ No newline at end of file



More information about the jbossws-commits mailing list