[jbossws-commits] JBossWS SVN: r6296 - in stack/native/trunk: src/test/java/org/jboss/test/ws/jaxws and 1 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Apr 9 05:50:01 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-04-09 05:50:01 -0400 (Wed, 09 Apr 2008)
New Revision: 6296

Added:
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java
Modified:
   stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
Log:
Move jbws1909 to native

Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml	2008-04-09 09:45:46 UTC (rev 6295)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml	2008-04-09 09:50:01 UTC (rev 6296)
@@ -195,6 +195,14 @@
       </fileset>
     </jar>
     
+  	<!-- jaxws-jbws1909 -->
+    <jar destfile="${tests.output.dir}/libs/jaxws-jbws1909.jar">
+      <fileset dir="${tests.output.dir}/classes">
+        <include name="org/jboss/test/ws/jaxws/jbws1909/*.class"/>
+      	<exclude name="org/jboss/test/ws/jaxws/jbws1909/*TestCase.class"/>
+      </fileset>
+    </jar>
+
   	<!-- jaxws-jbws1988 -->
     <jar destfile="${tests.output.dir}/libs/jaxws-jbws1988.jar">
       <fileset dir="${tests.output.dir}/classes">

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java	2008-04-09 09:50:01 UTC (rev 6296)
@@ -0,0 +1,58 @@
+/*
+ * 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.jbws1909;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-1909] RequestHandler.handlerWSDLResquest has dependency on Servlet API
+ * 
+ * http://jira.jboss.org/jira/browse/JBWS-1909
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 25-Feb-2007
+ */
+public class JBWS1909TestCase extends JBossWSTest
+{
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(JBWS1909TestCase.class, "jaxws-jbws1909.jar");
+   }
+
+   public void testWSDLSchema() throws Exception
+   {
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1909/TestEndpointImpl?wsdl");
+      QName serviceName = new QName("http://org.jboss.ws/jbws1909", "TestEndpointService");
+      Service service = Service.create(wsdlURL, serviceName);
+      TestEndpoint port = service.getPort(TestEndpoint.class);
+      String retStr = port.echo("hello");
+      assertEquals("hello|TestEndpointService", retStr);
+   }
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/JBWS1909TestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java	2008-04-09 09:50:01 UTC (rev 6296)
@@ -0,0 +1,32 @@
+/*
+ * 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.jbws1909;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jbws1909")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface TestEndpoint
+{
+   String echo(String input);
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java	2008-04-09 09:50:01 UTC (rev 6296)
@@ -0,0 +1,96 @@
+/*
+ * 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.jbws1909;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.w3c.dom.Element;
+
+ at WebService(serviceName = "TestEndpointService", name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jbws1909")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+ at Stateless
+public class TestEndpointImpl implements TestEndpoint
+{
+   // provide logging
+   private final static Logger log = Logger.getLogger(TestEndpointImpl.class);
+
+   @Resource
+   WebServiceContext context;
+
+   @WebMethod
+   public String echo(String input)
+   {
+      MessageContext msgContext = context.getMessageContext();
+      for (String key : msgContext.keySet())
+      {
+         log.info(key + "=" + msgContext.get(key));
+      }
+
+      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+      EndpointRegistry registry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+      
+      ObjectName oname = ObjectNameFactory.create("jboss.ws:context=jaxws-jbws1909,endpoint=TestEndpointImpl");
+      Endpoint endpoint = registry.getEndpoint(oname);
+      RequestHandler reqHandler = endpoint.getRequestHandler();
+      
+      try
+      {
+         ByteArrayOutputStream baos = new ByteArrayOutputStream();
+         reqHandler.handleWSDLRequest(endpoint, baos, null); // The context is null
+         
+         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+         Element root = DOMUtils.parse(bais);
+         Element serviceEl = DOMUtils.getFirstChildElement(root, new QName("http://schemas.xmlsoap.org/wsdl/", "service"));
+         String serviceName = DOMUtils.getAttributeValue(serviceEl, "name");
+         
+         input += "|" + serviceName;
+      }
+      catch (IOException ex)
+      {
+         throw new RuntimeException(ex);
+      }
+      return input;
+   }
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1909/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jbossws-commits mailing list