incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r490551 - in /incubator/yoko/trunk: bindings/ bindings/src/test/java/org/apache/yoko/bindings/corba/ bindings/src/test/resources/wsdl/type_test/ tools/src/main/java/org/apache/yoko/tools/processors/wsdl/
Date Wed, 27 Dec 2006 18:52:47 GMT
Author: bravi
Date: Wed Dec 27 10:52:46 2006
New Revision: 490551

URL: http://svn.apache.org/viewvc?view=rev&rev=490551
Log:
[YOKO-170] - Adding complex types to the type test framework.

Modified:
    incubator/yoko/trunk/bindings/pom.xml
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectWriterTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
    incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd
    incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test_impl_java.xsl
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java

Modified: incubator/yoko/trunk/bindings/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/pom.xml?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/pom.xml (original)
+++ incubator/yoko/trunk/bindings/pom.xml Wed Dec 27 10:52:46 2006
@@ -169,7 +169,7 @@
                                     <param name="groupID" expression="3" />
                                 </xslt>
                                 <xslt style="${test.resources.dir}/wsdl/type_test/type_test_wsdl.xsl"
in="${test.resources.dir}/wsdl/type_test/type_test.xsd" out="${generated.resources.test}/wsdl/type_test/type_test_corba_inc.wsdl">
-                                    <param name="inc_xsd_path" expression="${generated.resources.test}/wsdl/type_test"
/>
+                                    <param name="inc_xsd_path" expression="file:/${generated.resources.test}/wsdl/type_test"
/>
                                     <param name="use_style" expression="document" />
                                     <param name="tns_suffix" expression="corba" />
                                 </xslt>

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java
Wed Dec 27 10:52:46 2006
@@ -152,8 +152,8 @@
         InputStream iStream = oStream.create_input_stream();
         CorbaObjectReader reader = new CorbaObjectReader(iStream);
         
-        Short ushortValue = reader.readUShort();
-        assertTrue(ushortValue.shortValue() == (short)100);
+        Integer ushortValue = reader.readUShort();
+        assertTrue(ushortValue.intValue() == 100);
     }
     
     public void testReadLong() {
@@ -164,8 +164,8 @@
         InputStream iStream = oStream.create_input_stream();
         CorbaObjectReader reader = new CorbaObjectReader(iStream);
         
-        Long longValue = reader.readLong();
-        assertTrue(longValue.longValue() == -100000);
+        Integer longValue = reader.readLong();
+        assertTrue(longValue.intValue() == -100000);
     }
     
     public void testReadULong() {
@@ -188,7 +188,7 @@
         InputStream iStream = oStream.create_input_stream();
         CorbaObjectReader reader = new CorbaObjectReader(iStream);
         
-        BigInteger longlongValue = reader.readLongLong();
+        Long longlongValue = reader.readLongLong();
         assertTrue(longlongValue.longValue() == 1000000000);
     }
     

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectWriterTest.java?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectWriterTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectWriterTest.java
Wed Dec 27 10:52:46 2006
@@ -132,12 +132,12 @@
         OutputStream oStream = new OutputStream(buf);
         
         CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
-        Short ushortValue = new Short((short)123);
+        Integer ushortValue = new Integer(123);
         writer.writeUShort(ushortValue);
         
         InputStream iStream = oStream.create_input_stream();
-        short us = iStream.read_ushort();
-        assertTrue(us == ushortValue.shortValue());
+        int us = iStream.read_ushort();
+        assertTrue(us == ushortValue.intValue());
     }
     
     public void testWriteLong() {
@@ -145,12 +145,12 @@
         OutputStream oStream = new OutputStream(buf);
         
         CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
-        Long longValue = new Long(-1234567);
+        Integer longValue = new Integer(-1234567);
         writer.writeLong(longValue);
         
         InputStream iStream = oStream.create_input_stream();
-        long l = iStream.read_long();
-        assertTrue(l == longValue.longValue());
+        int l = iStream.read_long();
+        assertTrue(l == longValue.intValue());
     }
     
     public void testWriteULong() {
@@ -162,7 +162,7 @@
         writer.writeULong(ulongValue);
         
         InputStream iStream = oStream.create_input_stream();
-        long ul = iStream.read_ulong();
+        long ul = iStream.read_ulonglong();
         assertTrue(ul == ulongValue.longValue());
     }
     
@@ -171,7 +171,7 @@
         OutputStream oStream = new OutputStream(buf);
         
         CorbaObjectWriter writer = new CorbaObjectWriter(oStream);
-        BigInteger longlongValue = new BigInteger("-12345678900");
+        Long longlongValue = new Long("-12345678900");
         writer.writeLongLong(longlongValue);
         
         InputStream iStream = oStream.create_input_stream();

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java
Wed Dec 27 10:52:46 2006
@@ -200,7 +200,7 @@
             QName elIdlType = CorbaConstants.NT_CORBA_LONG;
             TypeCode elTC = orb.get_primitive_tc(TCKind.tk_long);
             CorbaPrimitiveHandler el = new CorbaPrimitiveHandler(elName, elIdlType, elTC,
null);
-            el.setValue(Long.valueOf(arrayData[i]));
+            el.setValue(Integer.valueOf(arrayData[i]));
             obj.addElement(el);
             objElements.add(el);
         }

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
Wed Dec 27 10:52:46 2006
@@ -26,7 +26,7 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-public class CorbaTypeTest extends AbstractTypeTestClient {
+public class CorbaTypeTest extends AbstractTypeTestClient1 {
     protected static final String WSDL_PATH = "/wsdl/type_test/type_test_corba.wsdl";
     protected static final QName SERVICE_NAME = new QName("http://apache.org/type_test/corba",
"CORBAService");
     protected static final QName PORT_NAME = new QName("http://apache.org/type_test/corba",
"CORBAPort");
@@ -42,7 +42,7 @@
         return new CorbaTypeTestSetup(suite) {
                 public void setUp() throws Exception {
                     super.setUp();
-                    initClient(AbstractTypeTestClient.class, SERVICE_NAME, PORT_NAME, WSDL_PATH);
+                    initClient(AbstractTypeTestClient1.class, SERVICE_NAME, PORT_NAME, WSDL_PATH);
                 }
             };
     }
@@ -77,6 +77,27 @@
     }
         
     public void testHexBinary() throws Exception  {
+    }
+
+    public void testEmptyStruct() throws Exception  {
+    }
+    public void testSimpleStruct() throws Exception  {
+    }
+
+    public void testStructWithNillables() throws Exception  {
+    }
+    public void testNestedStruct() throws Exception  {
+    }
+
+    public void testFixedArray() throws Exception  {
+    }
+    public void testBoundedArray() throws Exception  {
+    }
+    public void testUnboundedArray() throws Exception  {
+    }
+    public void testCompoundArray() throws Exception  {
+    }
+    public void testNestedArray() throws Exception  {
     }
 
     static abstract class CorbaTypeTestSetup extends TestSetup {

Modified: incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd (original)
+++ incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd Wed Dec
27 10:52:46 2006
@@ -96,5 +96,75 @@
     <itst:builtIn name="hexBinary"     javaType="byte[]" javaHolder="byte[]"/>
 
   </itst:it_test_group>
+
+  <itst:it_test_group ID="1">
+
+    <!-- Nillable elements -->
+    <element name="NillableString" type="string" nillable="true"/>
+    <element name="NillableStruct" type="x1:SimpleStruct" nillable="true"/>
+
+    <!-- Complex Types -->
+
+    <complexType name="StructWithNillables">
+        <sequence>
+            <element name="varFloat" nillable="true" type="float"/>
+            <element name="varInt" nillable="true" type="int"/>
+            <element name="varString" nillable="true" type="string"/>
+            <element name="varStruct" nillable="true" type="x1:SimpleStruct"/>
+        </sequence>
+    </complexType>
+
+    <complexType name="EmptyStruct">
+        <sequence/>
+    </complexType>
+
+    <complexType name="SimpleStruct">
+        <sequence>
+            <element name="varFloat" type="double"/>
+            <element name="varInt" type="unsignedLong"/>
+            <element name="varString" type="string" minOccurs="0"/>
+        </sequence>
+        <attribute name="varAttrString" type="string"/>
+    </complexType>
+    <complexType name="NestedStruct">
+        <sequence>
+            <element name="varString" type="string"/>
+            <element name="varInt" type="int"/>
+            <element name="varFloat" type="decimal"/>
+            <element name="varEmptyStruct" type="x1:EmptyStruct"/>
+            <element name="varStruct" type="x1:SimpleStruct"/>
+        </sequence>
+    </complexType>
+    <complexType name="FixedArray">
+        <sequence>
+            <element maxOccurs="3" minOccurs="3" name="item" type="int"/>
+        </sequence>
+    </complexType>
+    <complexType name="UnboundedArray">
+        <sequence>
+            <element maxOccurs="unbounded" minOccurs="0" name="item"
+		     type="string"/>
+        </sequence>
+    </complexType>
+    <complexType name="BoundedArray">
+        <sequence>
+            <element maxOccurs="3" minOccurs="1" name="item" type="float"/>
+        </sequence>
+    </complexType>
+    <complexType name="CompoundArray">
+        <sequence>
+            <element maxOccurs="unbounded" minOccurs="0" name="array1"
+		     type="string"/>
+            <element maxOccurs="unbounded" minOccurs="0" name="array2"
+		     type="string"/>
+        </sequence>
+    </complexType>
+    <complexType name="NestedArray">
+        <sequence>
+            <element maxOccurs="unbounded" minOccurs="0" name="subarray"
+		     type="x1:UnboundedArray"/>
+        </sequence>
+    </complexType>
+  </itst:it_test_group>
 </schema>
 

Modified: incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test_impl_java.xsl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test_impl_java.xsl?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test_impl_java.xsl
(original)
+++ incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test_impl_java.xsl
Wed Dec 27 10:52:46 2006
@@ -46,10 +46,10 @@
     public void testOneway(String x, String y) {
     }
     /*
-    public org.apache.type_test.corba.types1.AnonTypeElement testAnonTypeElement(
-            org.apache.type_test.corba.types1.AnonTypeElement x, 
-            Holder<org.apache.type_test.corba.types1.AnonTypeElement> y, 
-            Holder<org.apache.type_test.corba.types1.AnonTypeElement> z) {
+    public org.apache.type_test.types1.AnonTypeElement testAnonTypeElement(
+            org.apache.type_test.types1.AnonTypeElement x, 
+            Holder<org.apache.type_test.types1.AnonTypeElement> y, 
+            Holder<org.apache.type_test.types1.AnonTypeElement> z) {
         z.value.setVarFloat(y.value.getVarFloat());
         z.value.setVarInt(y.value.getVarInt());
         z.value.setVarString(y.value.getVarString());
@@ -58,8 +58,8 @@
         y.value.setVarInt(x.getVarInt());
         y.value.setVarString(x.getVarString());
 
-        org.apache.type_test.corba.types1.AnonTypeElement varReturn =
-            new org.apache.type_test.corba.types1.AnonTypeElement();
+        org.apache.type_test.types1.AnonTypeElement varReturn =
+            new org.apache.type_test.types1.AnonTypeElement();
         varReturn.setVarFloat(x.getVarFloat());
         varReturn.setVarInt(x.getVarInt());
         varReturn.setVarString(x.getVarString());
@@ -378,7 +378,7 @@
 
     <xsl:template match="itst:it_test_group/*" mode="import">
         <xsl:param name="id"/>
-        <xsl:value-of select="concat('import org.apache.type_test.corba.types',
+        <xsl:value-of select="concat('import org.apache.type_test.types',
             $id, '.', @name, ';&#10;')"/>
     </xsl:template>
 

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java?view=diff&rev=490551&r1=490550&r2=490551
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
Wed Dec 27 10:52:46 2006
@@ -532,7 +532,6 @@
         QName defaultName, XmlSchemaType parent, XmlSchemaAnnotation annotation, 
         boolean anonymous) throws Exception {
         CorbaTypeImpl corbaTypeImpl = null;        
-        
         // need to determine if its a primitive type.
         if (stype.getBaseSchemaType() != null) {
             corbaTypeImpl = processPrimitiveType(stype.getQName());
@@ -1064,6 +1063,9 @@
             name = createQNameTargetNamespace(defaultName.getLocalPart() + "Type");
         } else {
             schematypeName = checkPrefix(stype.getQName());
+            if (schematypeName == null) {
+                schematypeName = stype.getQName();
+            }
             name = createQNameCorbaNamespace(schematypeName.getLocalPart());
         }        
         
@@ -1752,11 +1754,7 @@
 
         return wsdltypes.processUnionBranches(corbaUnion, fields, caselist);
     }
-
-    
-        
-    
-        
+                       
     private boolean isDuplicate(CorbaTypeImpl corbaTypeImpl) {        
         String corbaName = corbaTypeImpl.getName();
         QName corbaType = corbaTypeImpl.getType();
@@ -1769,12 +1767,11 @@
             Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
             while (i.hasNext()) {
                 CorbaTypeImpl type = (CorbaTypeImpl)i.next();
-                if (corbaName.equals(type.getName())
-                    && corbaType.getLocalPart().equals(type.getType().getLocalPart()))
{
-                    if (corbaTypeImpl.getClass().getName()
-                        .equals(type.getClass().getName())) {                        
-                        return true;
-                    }
+                if ((corbaName != null) && type.getType() != null
+                    && (corbaName.equals(type.getName()))
+                    && (corbaType.getLocalPart().equals(type.getType().getLocalPart()))
+                    && (corbaTypeImpl.getClass().getName().equals(type.getClass().getName())))
{
+                    return true;
                 }
             }
         }



Mime
View raw message