Author: darran.lofthouse(a)jboss.com
Date: 2007-08-02 07:15:49 -0400 (Thu, 02 Aug 2007)
New Revision: 4093
Added:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1725/
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/Extension.wsdl
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/PasswordType.java
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/wstools-config.xml
Removed:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/Extension.wsdl
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/PasswordType.java
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/wstools-config.xml
Modified:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-core/src/java/org/jboss/ws/tools/XSDTypeToJava.java
Log:
JBWS-1768 - WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary is not
mapped to byte[].
Modified:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-core/src/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
---
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-core/src/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-08-02
11:14:11 UTC (rev 4092)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-core/src/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-08-02
11:15:49 UTC (rev 4093)
@@ -56,6 +56,7 @@
/** Class that converts a XSD Type into Java class
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @author mageshbk(a)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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/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)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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(a)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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/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)
===================================================================
---
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
(rev 0)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java 2007-08-02
11:15:49 UTC (rev 4093)
@@ -0,0 +1,60 @@
+/*
+ * 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.JBossWSTest;
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ * 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(a)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: branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725
(from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725)
Deleted:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/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)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/Extension.wsdl 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/Extension.wsdl
(from rev 3948,
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl)
===================================================================
---
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/Extension.wsdl
(rev 0)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/Extension.wsdl 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/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)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/PasswordType.java 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/PasswordType.java
(from rev 3948,
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java)
===================================================================
---
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/PasswordType.java
(rev 0)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/PasswordType.java 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/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)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/wstools-config.xml 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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:
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/wstools-config.xml
(from rev 3948,
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml)
===================================================================
---
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/wstools-config.xml
(rev 0)
+++
branches/jbossws-1.2.1.GA_JBWS-1768/jbossws-tests/src/resources/tools/jbws1725/wstools-config.xml 2007-08-02
11:15:49 UTC (rev 4093)
@@ -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