[jbossws-commits] JBossWS SVN: r3949 - in trunk/jbossws-core/src: test/java/org/jboss/test/ws/tools and 3 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Thu Jul 19 08:22:59 EDT 2007


Author: mageshbk at jboss.com
Date: 2007-07-19 08:22:59 -0400 (Thu, 19 Jul 2007)
New Revision: 3949

Added:
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
   trunk/jbossws-core/src/test/resources/tools/jbws1725/
   trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
   trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
   trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
Removed:
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
   trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
   trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
   trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
Modified:
   trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
Log:
[JBWS-1725] Merged from branches\jbossws-2.0

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java	2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java	2007-07-19 12:22:59 UTC (rev 3949)
@@ -56,6 +56,7 @@
 
 /** Class that converts a XSD Type into Java class
  *  @author <mailto:Anil.Saldhana at jboss.org>Anil Saldhana
+ *  @author mageshbk at jboss.com
  *  @since  Apr 4, 2005
  */
 public class XSDTypeToJava
@@ -202,7 +203,17 @@
             XSSimpleTypeDefinition xssimple = type.getSimpleType();
             QName q = new QName(xssimple.getNamespace(), xssimple.getName());
             QName qn = schemautils.patchXSDQName(q);
-            VAR v = new VAR("_value", typeMapping.getJavaType(qn).getName(), false);
+            Class javaType = typeMapping.getJavaType(qn);
+            String jtype = null;
+            if (javaType.isArray())
+            {
+               jtype = JavaUtils.getSourceName(javaType);
+            }
+            else
+            {
+               jtype = javaType.getName();
+            }
+            VAR v = new VAR("_value", jtype, false);
             vars.add(v);
          }
       }

Copied: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725 (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725)

Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java	2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java	2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,61 +0,0 @@
-/*
- * 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.tools.jbws1725;
-
-import java.io.File;
-
-import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
-import org.jboss.ws.tools.WSTools;
-import org.jboss.wsf.spi.test.JBossWSTest;
-
-/**
- * Test case for http://jira.jboss.com/jira/browse/JBWS-1725
- * 
- * WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary
- * is not mapped to byte[]
- * 
- * @author mageshbk at jboss.com
- * @since Jul 19, 2007
- */
-public class JBWS1725TestCase extends JBossWSTest
-{
-
-   public void testExtensionType() throws Exception
-   {
-      String resourceDir = "resources/tools/jbws1725";
-      String toolsDir = "tools/jbws1725";
-      String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
-      new WSTools().generate(args);
-
-      compareSource(resourceDir + "/PasswordType.java", toolsDir + "/org/jboss/test/ws/jbws1725/PasswordType.java");
-   }
-
-   private static void compareSource(final String expectedName, final String generatedName) throws Exception
-   {
-      File expected = new File(expectedName);
-      File generated = new File(generatedName);
-
-      JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
-      sc.validate();
-   }
-}

Copied: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java)
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java	                        (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java	2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,61 @@
+/*
+ * 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.tools.jbws1725;
+
+import java.io.File;
+
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.spi.test.JBossWSTest;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-1725
+ * 
+ * WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary
+ * is not mapped to byte[]
+ * 
+ * @author mageshbk at jboss.com
+ * @since Jul 19, 2007
+ */
+public class JBWS1725TestCase extends JBossWSTest
+{
+
+   public void testExtensionType() throws Exception
+   {
+      String resourceDir = "resources/tools/jbws1725";
+      String toolsDir = "tools/jbws1725";
+      String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+      new WSTools().generate(args);
+
+      compareSource(resourceDir + "/PasswordType.java", toolsDir + "/org/jboss/test/ws/jbws1725/PasswordType.java");
+   }
+
+   private static void compareSource(final String expectedName, final String generatedName) throws Exception
+   {
+      File expected = new File(expectedName);
+      File generated = new File(generatedName);
+
+      JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+      sc.validate();
+   }
+}

Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725 (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725)

Deleted: trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl	2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl	2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1725' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1725/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1725' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <types>
-  <schema targetNamespace='http://test.jboss.org/ws/jbws1725/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1725/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
-   <complexType name="PasswordType">
-    <simpleContent>
-      <extension base="xsd:base64Binary"/>
-    </simpleContent>
-   </complexType>
-   <complexType name='Person'>
-    <sequence>
-     <element name='firstName' nillable='true' type='string'/>
-     <element name='surname' nillable='true' type='string'/>
-     <element name='password' type='tns:PasswordType'/>
-    </sequence>
-   </complexType>
-   <complexType name='TelephoneNumber'>
-    <sequence>
-     <element name='Number'>
-       <complexType>
-         <sequence>
-           <element name='areaCode' nillable='true' type='string'/>
-           <element name='number' nillable='true' type='string'/>
-         </sequence>
-       </complexType>
-     </element>     
-    </sequence>
-   </complexType>
-   <element name='lookup' type='tns:Person'/>
-   <element name='lookupResponse' type='tns:TelephoneNumber'/>
-  </schema>
- </types>
- <message name='PhoneBook_lookup'>
-  <part element='ns1:lookup' name='parameters'/>
- </message>
- <message name='PhoneBook_lookupResponse'>
-  <part element='ns1:lookupResponse' name='result'/>
- </message>
- <portType name='PhoneBook'>
-  <operation name='lookup'>
-   <input message='tns:PhoneBook_lookup'/>
-   <output message='tns:PhoneBook_lookupResponse'/>
-  </operation>
- </portType>
- <binding name='PhoneBookBinding' type='tns:PhoneBook'>
-  <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
-  <operation name='lookup'>
-   <soap:operation soapAction=''/>
-   <input>
-    <soap:body use='literal'/>
-   </input>
-   <output>
-    <soap:body use='literal'/>
-   </output>
-  </operation>
- </binding>
- <service name='PhoneBook'>
-  <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
-   <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
-  </port>
- </service>
-</definitions>
\ No newline at end of file

Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl)
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl	                        (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl	2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1725' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1725/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1725' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+  <schema targetNamespace='http://test.jboss.org/ws/jbws1725/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1725/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+   <complexType name="PasswordType">
+    <simpleContent>
+      <extension base="xsd:base64Binary"/>
+    </simpleContent>
+   </complexType>
+   <complexType name='Person'>
+    <sequence>
+     <element name='firstName' nillable='true' type='string'/>
+     <element name='surname' nillable='true' type='string'/>
+     <element name='password' type='tns:PasswordType'/>
+    </sequence>
+   </complexType>
+   <complexType name='TelephoneNumber'>
+    <sequence>
+     <element name='Number'>
+       <complexType>
+         <sequence>
+           <element name='areaCode' nillable='true' type='string'/>
+           <element name='number' nillable='true' type='string'/>
+         </sequence>
+       </complexType>
+     </element>     
+    </sequence>
+   </complexType>
+   <element name='lookup' type='tns:Person'/>
+   <element name='lookupResponse' type='tns:TelephoneNumber'/>
+  </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+  <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+  <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+  <operation name='lookup'>
+   <input message='tns:PhoneBook_lookup'/>
+   <output message='tns:PhoneBook_lookupResponse'/>
+  </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+  <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+  <operation name='lookup'>
+   <soap:operation soapAction=''/>
+   <input>
+    <soap:body use='literal'/>
+   </input>
+   <output>
+    <soap:body use='literal'/>
+   </output>
+  </operation>
+ </binding>
+ <service name='PhoneBook'>
+  <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+   <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+  </port>
+ </service>
+</definitions>
\ No newline at end of file

Deleted: trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java	2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java	2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,27 +0,0 @@
-/*
- * JBossWS WS-Tools Generated Source
- *
- * Generation Date: Mon Jul 16 18:47:44 IST 2007
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- */
-
-package org.jboss.test.ws.jbws1725;
-
-
-public class  PasswordType
-{
-
-protected byte[] _value;
-public PasswordType(){}
-
-public PasswordType(byte[] _value){
-this._value=_value;
-}
-public byte[] get_value() { return _value ;}
-
-public void set_value(byte[] _value){ this._value=_value; }
-
-}

Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java)
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java	                        (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java	2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Mon Jul 16 18:47:44 IST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1725;
+
+
+public class  PasswordType
+{
+
+protected byte[] _value;
+public PasswordType(){}
+
+public PasswordType(byte[] _value){
+this._value=_value;
+}
+public byte[] get_value() { return _value ;}
+
+public void set_value(byte[] _value){ this._value=_value; }
+
+}

Deleted: trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml	2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml	2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,9 +0,0 @@
-<configuration xmlns="http://www.jboss.org/jbossws-tools"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
-
-  <wsdl-java location="resources/tools/jbws1725/Extension.wsdl" parameter-style="bare">
-    <mapping file="extended-mapping.xml"/>
-  </wsdl-java>
-
-</configuration>
\ No newline at end of file

Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml)
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml	                        (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml	2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,9 @@
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+  <wsdl-java location="resources/tools/jbws1725/Extension.wsdl" parameter-style="bare">
+    <mapping file="extended-mapping.xml"/>
+  </wsdl-java>
+
+</configuration>
\ No newline at end of file




More information about the jbossws-commits mailing list