incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r544924 - in /incubator/yoko/trunk/bindings/src/test: java/org/apache/yoko/bindings/corba/CorbaNestedObjReferenceTest.java resources/wsdl/NestedObjRef.wsdl
Date Wed, 06 Jun 2007 19:13:45 GMT
Author: bravi
Date: Wed Jun  6 12:13:44 2007
New Revision: 544924

URL: http://svn.apache.org/viewvc?view=rev&rev=544924
Log:
[YOKO-373] - Added a Nested object reference inside union test case.

Modified:
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaNestedObjReferenceTest.java
    incubator/yoko/trunk/bindings/src/test/resources/wsdl/NestedObjRef.wsdl

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaNestedObjReferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaNestedObjReferenceTest.java?view=diff&rev=544924&r1=544923&r2=544924
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaNestedObjReferenceTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaNestedObjReferenceTest.java
Wed Jun  6 12:13:44 2007
@@ -42,6 +42,7 @@
 import org.apache.schemas.yoko.idl.nestedobjref.FooFactory;
 import org.apache.schemas.yoko.idl.nestedobjref.FooFactoryCORBAService;
 import org.apache.schemas.yoko.idl.nestedobjref.FooRefStruct;
+import org.apache.schemas.yoko.idl.nestedobjref.FooRefUnion;
 
 import junit.framework.TestCase;
 
@@ -155,6 +156,24 @@
         assertTrue(portName.equals(OBJECT_PORT_NAME.getLocalPart()));
     }
 
+    public void testCreateFooRefInUnion() {
+        FooRefUnion ref = client.createFooRefInUnion();
+        EndpointReferenceType epr = ref.getU12();
+        assertNotNull(epr.getAddress().getValue());
+
+        QName interfaceName = EndpointReferenceUtils.getInterfaceName(epr);
+        assertTrue(interfaceName.equals(OBJECT_PORT_TYPE));
+
+        String wsdlLocation = EndpointReferenceUtils.getWSDLLocation(epr);
+        assertTrue(wsdlLocation.equals(wsdlUrl.toString()));
+
+        QName serviceName = EndpointReferenceUtils.getServiceName(epr);
+        assertTrue(serviceName.equals(OBJECT_SERVICE_NAME));
+
+        String portName = EndpointReferenceUtils.getPortName(epr);
+        assertTrue(portName.equals(OBJECT_PORT_NAME.getLocalPart()));
+    }
+
     // Helper methods that can be used throughout the test
     public EndpointReferenceType createEndpointReferenceType(String name, boolean serverSide)
{
         String corbaAddress = null;
@@ -252,6 +271,13 @@
             ref.setName("FooRefStruct");
             EndpointReferenceType epr = createEndpointReferenceType("StructRef", true);
             ref.setRef(epr);
+            return ref;
+        }
+
+        public FooRefUnion createFooRefInUnion() {
+            FooRefUnion ref = new FooRefUnion();
+            EndpointReferenceType epr = createEndpointReferenceType("UnionRef", true);
+            ref.setU12(epr);
             return ref;
         }
     }

Modified: incubator/yoko/trunk/bindings/src/test/resources/wsdl/NestedObjRef.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/resources/wsdl/NestedObjRef.wsdl?view=diff&rev=544924&r1=544923&r2=544924
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/resources/wsdl/NestedObjRef.wsdl (original)
+++ incubator/yoko/trunk/bindings/src/test/resources/wsdl/NestedObjRef.wsdl Wed Jun  6 12:13:44
2007
@@ -24,6 +24,24 @@
       <corba:member name="name" idltype="corba:string" />
       <corba:member name="ref" idltype="Foo" />
     </corba:struct>
+    <corba:enum xmlns:ns4="http://schemas.apache.org/yoko/idl/NestedObjRef" xmlns="http://schemas.apache.org/yoko/idl/NestedObjRef/typemap"
repositoryID="IDL:enum1:1.0" name="enum1" type="ns4:enum1">
+      <corba:enumerator value="e1_1" />
+      <corba:enumerator value="e1_2" />
+      <corba:enumerator value="e1_3" />
+      <corba:enumerator value="e1_4" />
+      <corba:enumerator value="e1_5" />
+      <corba:enumerator value="e1_6" />
+    </corba:enum>
+    <corba:union xmlns:ns4="http://schemas.apache.org/yoko/idl/NestedObjRef" xmlns="http://schemas.apache.org/yoko/idl/NestedObjRef/typemap"
discriminator="enum1" repositoryID="IDL:union1:1.0" name="FooRefUnion" type="ns4:FooRefUnion">
+      <corba:unionbranch name="u1_1" idltype="corba:long">
+        <corba:case label="e1_1" />
+      </corba:unionbranch>
+      <corba:unionbranch name="u1_2" idltype="Foo">
+        <corba:case label="e1_3" />
+        <corba:case label="e1_2" />
+      </corba:unionbranch>
+      <corba:unionbranch name="u1_3" idltype="corba:short" default="true" />
+    </corba:union>
   </corba:typeMapping>
   <wsdl:types>
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/NestedObjRef"
xmlns="http://schemas.apache.org/yoko/idl/NestedObjRef" xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
@@ -55,6 +73,16 @@
           </xs:element>
         </xs:sequence>
       </xs:complexType>
+      <xs:complexType name="FooRefUnion">
+        <xs:choice>
+          <xs:element name="u1_1" type="xs:int">
+          </xs:element>
+          <xs:element name="u1_2" type="wsa:EndpointReferenceType">
+          </xs:element>
+          <xs:element name="u1_3" type="xs:short">
+          </xs:element>
+        </xs:choice>
+      </xs:complexType>
       <xs:element name="createFooRefInStruct">
         <xs:complexType>
           <xs:sequence>
@@ -69,12 +97,30 @@
           </xs:sequence>
         </xs:complexType>
       </xs:element>
+      <xs:element name="createFooRefInUnion">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="createFooRefInUnionResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="FooRefUnion">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
     </xs:schema>
   </wsdl:types>
   <wsdl:message name="createFooRefInStructResponse">
     <wsdl:part name="outparameter" element="tns:createFooRefInStructResponse">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="createFooRefInUnionResponse">
+    <wsdl:part name="outparameter" element="tns:createFooRefInUnionResponse">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="doBarResponse">
     <wsdl:part name="outparameter" element="tns:doBarResponse">
     </wsdl:part>
@@ -87,6 +133,10 @@
     <wsdl:part name="inparameter" element="tns:createFooRefInStruct">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="createFooRefInUnion">
+    <wsdl:part name="inparameter" element="tns:createFooRefInUnion">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:portType name="FooFactory">
     <wsdl:operation name="createFooRefInStruct">
       <wsdl:input name="createFooRefInStructRequest" message="tns:createFooRefInStruct">
@@ -94,6 +144,12 @@
       <wsdl:output name="createFooRefInStructResponse" message="tns:createFooRefInStructResponse">
     </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="createFooRefInUnion">
+      <wsdl:input name="createFooRefInUnionRequest" message="tns:createFooRefInUnion">
+    </wsdl:input>
+      <wsdl:output name="createFooRefInUnionResponse" message="tns:createFooRefInUnionResponse">
+    </wsdl:output>
+    </wsdl:operation>
   </wsdl:portType>
   <wsdl:portType name="Foo">
     <wsdl:operation name="doBar">
@@ -112,6 +168,15 @@
       <wsdl:input name="createFooRefInStructRequest">
       </wsdl:input>
       <wsdl:output name="createFooRefInStructResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="createFooRefInUnion">
+      <corba:operation name="createFooRefInUnion">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/NestedObjRef/typemap"
name="return" idltype="FooRefUnion" />
+      </corba:operation>
+      <wsdl:input name="createFooRefInUnionRequest">
+      </wsdl:input>
+      <wsdl:output name="createFooRefInUnionResponse">
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>



Mime
View raw message