[jbossws-commits] JBossWS SVN: r3796 - in branches/jbossws-2.0: jbossws-core/ant-import-tests and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jul 4 05:09:03 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-04 05:09:03 -0400 (Wed, 04 Jul 2007)
New Revision: 3796

Added:
   branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/
   branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvc.java
   branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvcImpl.java
   branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
Modified:
   branches/jbossws-2.0/build/ant-import/build-release.xml
   branches/jbossws-2.0/jbossws-core/ant-import-tests/build-jars-jaxws.xml
   branches/jbossws-2.0/jbossws-core/src/main/etc/default.mf
   branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
Log:
[JBWS-771] Use part names that are friendly to .NET

Modified: branches/jbossws-2.0/build/ant-import/build-release.xml
===================================================================
--- branches/jbossws-2.0/build/ant-import/build-release.xml	2007-07-03 17:03:17 UTC (rev 3795)
+++ branches/jbossws-2.0/build/ant-import/build-release.xml	2007-07-04 09:09:03 UTC (rev 3796)
@@ -19,18 +19,18 @@
     <echo message="*"/>
     <echo message="* Almost there, please do these steps manually"/>
     <echo message="*"/>
-    <echo message="*  1) Create SVN tag: jbossws-${version.id}"/>
-    <echo message="*  2) Update portal-content/project.xml"/>
-    <echo message="*  3) Update portal-content/counter.xml"/>
-    <echo message="*  4) Update news in portal-content/freezone/projectDescription.html"/>
-    <echo message="*  5) Verify release notes and install instructions"/>
-    <echo message="*  6) Publish the interop endpoints (ant -f jboss-tests/build.xml publish-interop-endpoints)"/>
-    <echo message="*  7) Commit the portal-content"/>
-    <echo message="*  8) Commit the repository jars"/>
-    <echo message="*  9) Write a sticky post on the user forum"/>
-    <echo message="* 10) Release the jbossws-${version.id} version in JIRA"/>
-    <echo message="* 11) Post a message to jbossws-announce at lists.jboss.org"/>
-    <echo message="* 12) Post a message to thecore at jboss.org"/>
+    <echo message="*  - Create SVN tag: jbossws-${version.id}"/>
+    <echo message="*  - Update portal-content/project.xml"/>
+    <echo message="*  - Update portal-content/counter.xml"/>
+    <echo message="*  - Update news in portal-content/freezone/projectDescription.html"/>
+    <echo message="*  - Verify release notes and install instructions"/>
+    <echo message="*  - Publish the interop endpoints (ant -f jboss-tests/build.xml publish-interop-endpoints)"/>
+    <echo message="*  - Commit the portal-content"/>
+    <echo message="*  - Commit the repository jars"/>
+    <echo message="*  - Write a sticky post on the user forum"/>
+    <echo message="*  - Release the jbossws-${version.id} version in JIRA"/>
+    <echo message="*  - Post a message to jbossws-announce at lists.jboss.org"/>
+    <echo message="*  - Post a message to thecore at jboss.org"/>
     <echo message="*"/>
     <echo message="*********************************************"/>
   </target>

Modified: branches/jbossws-2.0/jbossws-core/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/ant-import-tests/build-jars-jaxws.xml	2007-07-03 17:03:17 UTC (rev 3795)
+++ branches/jbossws-2.0/jbossws-core/ant-import-tests/build-jars-jaxws.xml	2007-07-04 09:09:03 UTC (rev 3796)
@@ -119,6 +119,14 @@
       </classes>
     </war>
 
+	  <!-- jaxws-jbws771 -->
+	  <jar destfile="${tests.output.dir}/libs/jaxws-jbws771.jar">
+		  <fileset dir="${tests.output.dir}/classes">
+			  <include name="org/jboss/test/ws/jaxws/jbws771/*.class"/>
+        <exclude name="org/jboss/test/ws/jaxws/jbws771/*TestCase.class"/>
+		  </fileset>
+	  </jar>
+	  
     <!-- jaxws-jbws860 -->
     <war warfile="${tests.output.dir}/libs/jaxws-jbws860.war" webxml="${tests.output.dir}/resources/jaxws/jbws860/WEB-INF/web.xml">
       <classes dir="${tests.output.dir}/classes">
@@ -186,6 +194,13 @@
       </classes>
     </war>
 
+	  <!-- jaxws-jbws1283 -->
+    <jar destfile="${tests.output.dir}/libs/jaxws-jbws1283.jar">
+      <fileset dir="${tests.output.dir}/classes">
+        <include name="org/jboss/test/ws/jaxws/jbws1283/*.*"/>        
+      </fileset>
+    </jar>
+
     <!-- jaxws-jbws1357 -->
     <war warfile="${tests.output.dir}/libs/jaxws-jbws1357.war" webxml="${tests.output.dir}/resources/jaxws/jbws1357/WEB-INF/web.xml">
       <classes dir="${tests.output.dir}/classes">
@@ -197,6 +212,14 @@
       </fileset>
     </war>
 
+	  <!-- jaxws-jbws1422 -->
+	  <jar destfile="${tests.output.dir}/libs/jaxws-jbws1422.jar">
+		  <fileset dir="${tests.output.dir}/classes">
+			  <include name="org/jboss/test/ws/jaxws/jbws1422/*.class"/>
+        <exclude name="org/jboss/test/ws/jaxws/jbws1422/*TestCase.class"/>
+		  </fileset>
+	  </jar>
+	  
     <!-- jaxws-jbws1446 -->
     <jar jarfile="${tests.output.dir}/libs/jaxws-jbws1446.jar">
       <fileset dir="${tests.output.dir}/classes">
@@ -204,6 +227,14 @@
       </fileset>
     </jar>
     
+	  <!-- jaxws-jbws1505 -->
+    <jar destfile="${tests.output.dir}/libs/jaxws-jbws1505.jar">
+      <fileset dir="${tests.output.dir}/classes">
+        <include name="org/jboss/test/ws/jaxws/jbws1505/*.class"/>
+        <exclude name="org/jboss/test/ws/jaxws/jbws1505/*TestCase.class"/>
+      </fileset>
+    </jar>
+
     <!-- jaxws-jbws1529 -->
     <war warfile="${tests.output.dir}/libs/jaxws-jbws1529.war" webxml="${tests.output.dir}/resources/jaxws/jbws1529/WEB-INF/web.xml">
       <classes dir="${tests.output.dir}/classes">
@@ -267,27 +298,6 @@
       </metainf>
     </jar>
 
-	  <!-- jaxws-jbws1283 -->
-    <jar destfile="${tests.output.dir}/libs/jaxws-jbws1283.jar">
-      <fileset dir="${tests.output.dir}/classes">
-        <include name="org/jboss/test/ws/jaxws/jbws1283/*.*"/>        
-      </fileset>
-    </jar>
-
-	  <!-- jaxws-jbws1422 -->
-	  <jar destfile="${tests.output.dir}/libs/jaxws-jbws1422.jar">
-		  <fileset dir="${tests.output.dir}/classes">
-			  <include name="org/jboss/test/ws/jaxws/jbws1422/*.*"/>
-		  </fileset>
-	  </jar>
-	  
-	  <!-- jaxws-jbws1505 -->
-    <jar destfile="${tests.output.dir}/libs/jaxws-jbws1505.jar">
-      <fileset dir="${tests.output.dir}/classes">
-        <include name="org/jboss/test/ws/jaxws/jbws1505/*.*"/>
-      </fileset>
-    </jar>
-
     <!-- jaxws-jbws1611 -->
     <war destfile="${tests.output.dir}/libs/jaxws-jbws1611.war" webxml="${tests.output.dir}/resources/jaxws/jbws1611/WEB-INF/web.xml">
       <classes dir="${tests.output.dir}/classes">

Modified: branches/jbossws-2.0/jbossws-core/src/main/etc/default.mf
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/etc/default.mf	2007-07-03 17:03:17 UTC (rev 3795)
+++ branches/jbossws-2.0/jbossws-core/src/main/etc/default.mf	2007-07-04 09:09:03 UTC (rev 3796)
@@ -10,4 +10,4 @@
 Implementation-Vendor-Id: @implementation.vendor.id@
 Class-Path: jbossws-spi.jar jboss-jaxrpc.jar jboss-jaxws.jar jboss-saaj.jar 
   activation.jar commons-logging.jar concurrent.jar javassist.jar jaxb-api.jar jaxb-impl.jar 
-  mail.jar jboss-remoting.jar jboss-xml-binding.jar  policy.jar wsdl4j.jar
\ No newline at end of file
+  mail.jar jboss-remoting.jar jboss-xml-binding.jar policy.jar stax-api.jar wsdl4j.jar
\ No newline at end of file

Modified: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java	2007-07-03 17:03:17 UTC (rev 3795)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1422/JBWS1422TestCase.java	2007-07-04 09:09:03 UTC (rev 3796)
@@ -25,10 +25,6 @@
 
 import java.net.URL;
 
-import javax.wsdl.Definition;
-import javax.wsdl.Message;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
@@ -39,7 +35,6 @@
 
 /**
  * [JBWS-1422] NPE if @WebParam.name like "mX.."
- * [JBWS-771] Use part names that are friendly to .NET
  * 
  * @author Thomas.Diesler at jboss.com 
  */
@@ -72,25 +67,4 @@
       String result = port.cancel("myFooBar");
       assertEquals("Cancelled-myFooBar", result);
    }
-   
-   // [JBWS-771] Use part names that are friendly to .NET
-   public void testMessagePartNames() throws Exception
-   {
-      Definition wsdl = getWSDLDefinition(wsdlURL.toExternalForm());
-      
-      Message wsdlReqMessage = wsdl.getMessage(new QName(TARGET_NAMESPACE, "IWebsvc_cancel"));
-      assertNotNull("Expected part with name 'parameters' in: " + wsdlReqMessage, wsdlReqMessage.getPart("parameters"));
-      
-      Message wsdlResMessage = wsdl.getMessage(new QName(TARGET_NAMESPACE, "IWebsvc_cancelResponse"));
-      assertNotNull("Expected part with name 'parameters' in: " + wsdlResMessage, wsdlResMessage.getPart("parameters"));
-   }
-   
-   private Definition getWSDLDefinition(String wsdlLocation) throws Exception
-   {
-      WSDLFactory wsdlFactory = WSDLFactory.newInstance();
-      WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
-
-      Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
-      return definition;
-   }
 }

Added: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvc.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvc.java	                        (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvc.java	2007-07-04 09:09:03 UTC (rev 3796)
@@ -0,0 +1,35 @@
+/*
+ * 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.jbws771;
+
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
+public interface IWebsvc
+{
+   public String submit(@WebParam(name = "foo") String foo);
+   
+   public String cancel(@WebParam(name = "foo") String foo, @WebParam(name = "bar", header=true) String bar);
+}

Added: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvcImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvcImpl.java	                        (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/IWebsvcImpl.java	2007-07-04 09:09:03 UTC (rev 3796)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbws771;
+
+import javax.ejb.Stateless;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+ at Stateless
+ at WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws771.IWebsvc", serviceName = "JBWS771Service")
+public class IWebsvcImpl implements IWebsvc
+{
+   public String submit(@WebParam(name = "foo") String foo)
+   {
+      return "submit-" + foo;
+   }
+   
+   public String cancel(@WebParam(name = "foo") String foo, @WebParam(name = "bar", header=true) String bar)
+   {
+      return "cancel-" + foo + bar;
+   }
+}

Added: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java	                        (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java	2007-07-04 09:09:03 UTC (rev 3796)
@@ -0,0 +1,147 @@
+/*
+ * 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.jbws771;
+
+// $Id: JBWS771TestCase.java 3729 2007-06-26 19:38:00Z thomas.diesler at jboss.com $
+
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.Definition;
+import javax.wsdl.Message;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.soap.SOAPBody;
+import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.spi.test.JBossWSTest;
+import org.jboss.wsf.spi.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-771] Use part names that are friendly to .NET
+ * 
+ * @author Thomas.Diesler at jboss.com 
+ * @since 04-Jul-2007
+ */
+public class JBWS771TestCase extends JBossWSTest
+{
+   private static final String TARGET_NAMESPACE = "http://jbws771.jaxws.ws.test.jboss.org/";
+   private static URL wsdlURL;
+   private static IWebsvc port;
+
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(JBWS771TestCase.class, "jaxws-jbws771.jar");
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      if (port == null)
+      {
+         QName serviceName = new QName(TARGET_NAMESPACE, "JBWS771Service");
+         wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws771/IWebsvcImpl?wsdl");
+
+         Service service = Service.create(wsdlURL, serviceName);
+         port = service.getPort(IWebsvc.class);
+      }
+   }
+
+   public void testSubmit() throws Exception
+   {
+      String result = port.submit("foo");
+      assertEquals("submit-foo", result);
+   }
+   
+   public void testCancel() throws Exception
+   {
+      String result = port.cancel("foo", "bar");
+      assertEquals("cancel-foobar", result);
+   }
+   
+   // [JBWS-771] Use part names that are friendly to .NET
+   public void testMessagePartNames() throws Exception
+   {
+      Definition wsdl = getWSDLDefinition(wsdlURL.toExternalForm());
+      
+      Message wsdlReqMessage = wsdl.getMessage(new QName(TARGET_NAMESPACE, "IWebsvc_cancel"));
+      assertNotNull("Expected part with name 'parameters' in: " + wsdlReqMessage, wsdlReqMessage.getPart("parameters"));
+      assertNotNull("Expected part with name 'bar' in: " + wsdlReqMessage, wsdlReqMessage.getPart("bar"));
+      
+      Message wsdlResMessage = wsdl.getMessage(new QName(TARGET_NAMESPACE, "IWebsvc_cancelResponse"));
+      assertNotNull("Expected part with name 'parameters' in: " + wsdlResMessage, wsdlResMessage.getPart("parameters"));
+      
+      /*
+       <binding name='IWebsvcBinding' type='tns:IWebsvc'>
+        <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+        <operation name='cancel'>
+         <soap:operation soapAction=''/>
+         <input>
+          <soap:body parts='parameters' use='literal'/>
+          <soap:header message='tns:IWebsvc_cancel' part='bar' use='literal'></soap:header>
+         </input>
+         <output>
+          <soap:body use='literal'/>
+         </output>
+        </operation>
+       */
+      Binding wsdlBinding = wsdl.getBinding(new QName(TARGET_NAMESPACE, "IWebsvcBinding"));
+      BindingOperation bindingOperation = wsdlBinding.getBindingOperation("cancel", null, null);
+      
+      boolean foundBody = false;
+      boolean foundHeader = false;
+      List<ExtensibilityElement> extList = bindingOperation.getBindingInput().getExtensibilityElements();
+      for (ExtensibilityElement extElement : extList)
+      {
+         if (extElement instanceof SOAPBody)
+         {
+            SOAPBody body = (SOAPBody)extElement;
+            assertEquals("parameters", body.getParts().get(0));
+            foundBody = true;
+         }
+         if (extElement instanceof SOAPHeader)
+         {
+            SOAPHeader header = (SOAPHeader)extElement;
+            assertEquals("bar", header.getPart());
+            foundHeader = true;
+         }
+      }
+      assertTrue("Found soap:body", foundBody);
+      assertTrue("Found soap:header", foundHeader);
+   }
+   
+   private Definition getWSDLDefinition(String wsdlLocation) throws Exception
+   {
+      WSDLFactory wsdlFactory = WSDLFactory.newInstance();
+      WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+
+      Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
+      return definition;
+   }
+}




More information about the jbossws-commits mailing list