[jbossws-commits] JBossWS SVN: r17198 - in shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test: java/org/jboss/test/ws/publish and 1 other directory.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Jan 8 09:22:10 EST 2013


Author: alessio.soldano at jboss.com
Date: 2013-01-08 09:22:10 -0500 (Tue, 08 Jan 2013)
New Revision: 17198

Added:
   shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java
   shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml
   shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml
Modified:
   shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/ant-import/build-samples-jaxws.xml
   shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
Log:
[JBPAPP6-1676][JBPAPP6-1678] Adding testcase


Modified: shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/ant-import/build-samples-jaxws.xml
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/ant-import/build-samples-jaxws.xml	2013-01-08 12:02:28 UTC (rev 17197)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/ant-import/build-samples-jaxws.xml	2013-01-08 14:22:10 UTC (rev 17198)
@@ -512,17 +512,19 @@
       </classes>
     </war>
 
-    <!-- endpoint-publish.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/**/*.class"/>
+        <include name="org/jboss/test/ws/publish/EndpointImpl5.xml"/>
+        <include name="org/jboss/test/ws/publish/TestService.xml"/>
         <exclude name="org/jboss/test/ws/publish/*TestCase.class"/>
       </classes>
       <classes dir="${tests.output.dir}/test-classes/org/jboss/test/ws/publish" erroronmissingdir="false">
         <include name="WEB-INF/wsdl/**" />
       </classes>
       <webinf dir="${tests.output.dir}/test-resources/publish/WEB-INF" erroronmissingdir="false">
-      	<include name="wsdl/**"/>
+        <include name="wsdl/**"/>
       </webinf>
     </war>
   	

Added: shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java	                        (rev 0)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java	2013-01-08 14:22:10 UTC (rev 17198)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.logging.Logger;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+ at WebServiceProvider
+ at ServiceMode(value = Service.Mode.MESSAGE)
+public class EndpointImpl5 implements Provider<SOAPMessage>
+{
+   // Provide logging
+   private static Logger log = Logger.getLogger(EndpointImpl5.class);
+
+   public SOAPMessage invoke(SOAPMessage request)
+   {
+      log.info("echo (5): " + request);
+      try {
+         SOAPBody sb = request.getSOAPBody();
+         NodeList nl = sb.getElementsByTagName("arg0");
+         if (nl.getLength() != 1) {
+            throw new IllegalArgumentException("Unexpected input!");
+         }
+         Node ret = sb.getOwnerDocument().createElement("return");
+         Node arg0 = nl.item(0);
+         ret.appendChild(arg0.getFirstChild().cloneNode(true));
+         Node parent = arg0.getParentNode();
+         parent.removeChild(arg0);
+         parent.appendChild(ret);
+      } catch (Exception e) {
+         throw new RuntimeException(e);
+      }
+      return request;
+   }
+}

Added: shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml	                        (rev 0)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml	2013-01-08 14:22:10 UTC (rev 17198)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+  <wsdl:definitions name="EndpointService5"
+                    targetNamespace="http://publish.ws.test.jboss.org/"
+                    xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
+                    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                    xmlns:tns="http://publish.ws.test.jboss.org/"
+                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <wsdl:types>
+    <xsd:schema>
+      <xsd:import namespace="http://publish.ws.test.jboss.org/" schemaLocation="TestService.xml" />
+    </xsd:schema>
+  </wsdl:types>
+  <wsdl:message name="echoStringResponse">
+    <wsdl:part name="return" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="echoString">
+    <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="Endpoint">
+    <wsdl:operation name="echoString">
+      <wsdl:input message="tns:echoString" name="echoString">
+    </wsdl:input>
+      <wsdl:output message="tns:echoStringResponse" name="echoStringResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="EndpointService5SoapBinding" type="tns:Endpoint">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="echoString">
+      <soap:operation soapAction="urn:EchoString" style="rpc"/>
+      <wsdl:input name="echoString">
+        <soap:body namespace="http://publish.ws.test.jboss.org/" use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="echoStringResponse">
+        <soap:body namespace="http://publish.ws.test.jboss.org/" use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="EndpointService5">
+    <wsdl:port binding="tns:EndpointService5SoapBinding" name="EndpointPort5">
+      <soap:address location="http://localhost:8080/ep-publish-test/pattern5"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Modified: shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java	2013-01-08 12:02:28 UTC (rev 17197)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java	2013-01-08 14:22:10 UTC (rev 17198)
@@ -78,6 +78,7 @@
          map.put("/pattern2", "org.jboss.test.ws.publish.EndpointImpl2");
          map.put("/pattern3", "org.jboss.test.ws.publish.EndpointImpl3");
          map.put("/pattern4", "org.jboss.test.ws.publish.EndpointImpl4");
+         map.put("/pattern5", "org.jboss.test.ws.publish.EndpointImpl5");
          
          ctx = publisher.publish("ep-publish-test", Thread.currentThread().getContextClassLoader(), map, createMetaData());
          
@@ -97,6 +98,7 @@
          invoke(new URL("http://" + jbossBindAddress + ":8080/ep-publish-test/pattern2?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService2"));
          invoke(new URL("http://" + jbossBindAddress + ":8080/ep-publish-test/pattern3?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService3"));
          invoke(new URL("http://" + jbossBindAddress + ":8080/ep-publish-test/pattern4?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService4"));
+         invoke(new URL("http://" + jbossBindAddress + ":8080/ep-publish-test/pattern5?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService5"));
          
          res.getWriter().print("1");
       }
@@ -122,7 +124,7 @@
          }
       }
    }
-   
+
    private WebservicesMetaData createMetaData() {
       WebservicesMetaData metadata = new WebservicesMetaData();
       WebserviceDescriptionMetaData webserviceDescription = new WebserviceDescriptionMetaData(metadata);
@@ -133,7 +135,22 @@
       portComponent.setServiceEndpointInterface("org.jboss.test.ws.publish.EndpointImpl4");
       portComponent.setWsdlPort(new QName("http://publish.ws.test.jboss.org/", "EndpointPort4"));
       portComponent.setWsdlService(new QName("http://publish.ws.test.jboss.org/", "EndpointService4"));
+      // mandatory servlet link (because endpoint is POJO) - needed for proper matching of endpoint with WebservicesMD
+      portComponent.setServletLink("org.jboss.test.ws.publish.EndpointImpl4");
+      // if endpoint ^ would be EJB, users have to use setEjbLink() method instead
       webserviceDescription.addPortComponent(portComponent);
+      WebserviceDescriptionMetaData webserviceDescription2 = new WebserviceDescriptionMetaData(metadata);
+      metadata.addWebserviceDescription(webserviceDescription2);
+      webserviceDescription2.setWsdlFile("org/jboss/test/ws/publish/EndpointImpl5.xml"); //test JBWS-3540
+      PortComponentMetaData portComponent2 = new PortComponentMetaData(webserviceDescription2);
+      portComponent2.setPortComponentName("PortComponent5"); //unique ID
+      portComponent2.setServiceEndpointInterface("org.jboss.test.ws.publish.EndpointImpl5");
+      portComponent2.setWsdlPort(new QName("http://publish.ws.test.jboss.org/", "EndpointPort5"));
+      portComponent2.setWsdlService(new QName("http://publish.ws.test.jboss.org/", "EndpointService5"));
+      // mandatory servlet link (because endpoint is POJO) - needed for proper matching of endpoint with WebservicesMD
+      portComponent2.setServletLink("org.jboss.test.ws.publish.EndpointImpl5");
+      // if endpoint ^ would be EJB, users have to use setEjbLink() method instead
+      webserviceDescription2.addPortComponent(portComponent2);
       return metadata;
    }
    

Added: shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml
===================================================================
--- shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml	                        (rev 0)
+++ shared-testsuite/branches/jbossws-shared-testsuite-4.0.x/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml	2013-01-08 14:22:10 UTC (rev 17198)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema version="1.0" xmlns="http://www.w3.org/2001/XMLSchema" 
+    elementFormDefault="qualified" attributeFormDefault="unqualified" 
+    targetNamespace="http://publish.ws.test.jboss.org/"
+    xmlns:tns="http://publish.ws.test.jboss.org/">
+
+    <element name='foo' type='tns:foo'/>
+</schema>
\ No newline at end of file



More information about the jbossws-commits mailing list