incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eno...@apache.org
Subject svn commit: r483586 [4/4] - in /incubator/yoko/trunk/bindings/src/test: java/org/apache/yoko/bindings/corba/ java/org/apache/yoko/bindings/corba/interceptors/ java/org/apache/yoko/bindings/corba/types/ resources/wsdl/
Date Thu, 07 Dec 2006 18:11:28 GMT
Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java?view=diff&rev=483586&r1=483585&r2=483586
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java
Thu Dec  7 10:11:27 2006
@@ -18,7 +18,6 @@
  */
 package org.apache.yoko.bindings.corba.types;
 
-import java.util.Properties;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
@@ -30,7 +29,7 @@
 public class CorbaPrimitiveHandlerTest extends TestCase {
 
     private ORB orb;
-
+    
     public CorbaPrimitiveHandlerTest(String arg0) {
         super(arg0);
     }
@@ -38,18 +37,17 @@
     public static void main(String[] args) {
         junit.textui.TestRunner.run(CorbaArrayHandlerTest.class);
     }
-
+    
     protected void setUp() throws Exception {
         super.setUp();
-
-        java.util.Properties props = new Properties();
-        props.putAll(System.getProperties());
+        
+        java.util.Properties props = System.getProperties();
         props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
         props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
         props.put("yoko.orb.id", "Yoko-Server-Binding");
         orb = ORB.init(new String[0], props);
     }
-
+    
     protected void tearDown() throws Exception {
         if (orb != null) {
             try {
@@ -62,17 +60,17 @@
 
     public void testCreateCorbaBoolean() {
         Boolean val = new Boolean(false);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("boolean"),
                                       CorbaConstants.NT_CORBA_BOOLEAN,
                                       orb.get_primitive_tc(TCKind.tk_boolean),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
-
+        
         obj.setValue(val);
         Object resultObj = obj.getValue();
         assertNotNull(resultObj);
@@ -80,16 +78,16 @@
         Boolean boolResult = (Boolean)resultObj;
         assertTrue(boolResult.booleanValue() == val.booleanValue());
     }
-
+    
     public void testCreateCorbaChararacter() {
         Character val = new Character('c');
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("char"),
                                       CorbaConstants.NT_CORBA_CHAR,
                                       orb.get_primitive_tc(TCKind.tk_char),
                                       null);
         assertNotNull(obj);
-
+        
         // Yoko maps the XML char type to a Byte so we need to provide the string data as
a Byte value
         Byte byteValue = new Byte((byte)val.charValue());
         obj.setValueFromData(byteValue.toString());
@@ -105,18 +103,18 @@
         assertTrue(resultObj instanceof Character);
         Character charResult = (Character)resultObj;
         assertTrue(charResult.charValue() == val.charValue());
-
+        
     }
 
     public void testCreateCorbaWChararacter() {
         Character val = new Character('w');
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("wchar"),
                                       CorbaConstants.NT_CORBA_WCHAR,
                                       orb.get_primitive_tc(TCKind.tk_wchar),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData("w");
         String result = obj.getValueData();
         assertTrue(val.charValue() == result.charAt(0));
@@ -131,13 +129,13 @@
 
     public void testCreateCorbaOctet() {
         Byte val = new Byte((byte)100);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("octet"),
                                       CorbaConstants.NT_CORBA_OCTET,
                                       orb.get_primitive_tc(TCKind.tk_octet),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -149,16 +147,16 @@
         Byte byteResult = (Byte)resultObj;
         assertTrue(byteResult.byteValue() == val.byteValue());
     }
-
+    
     public void testCreateCorbaShort() {
         Short val = new Short((short)1234);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("short"),
                                       CorbaConstants.NT_CORBA_SHORT,
                                       orb.get_primitive_tc(TCKind.tk_short),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -173,13 +171,13 @@
 
     public void testCreateCorbaUShort() {
         Short val = new Short((short)4321);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("ushort"),
                                       CorbaConstants.NT_CORBA_USHORT,
                                       orb.get_primitive_tc(TCKind.tk_ushort),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -194,13 +192,13 @@
 
     public void testCreateCorbaLong() {
         Integer val = new Integer(123456);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("long"),
                                       CorbaConstants.NT_CORBA_LONG,
                                       orb.get_primitive_tc(TCKind.tk_long),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -215,13 +213,13 @@
 
     public void testCreateCorbaULong() {
         Integer val = new Integer(654321);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("ulong"),
                                       CorbaConstants.NT_CORBA_ULONG,
                                       orb.get_primitive_tc(TCKind.tk_ulong),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -236,13 +234,13 @@
 
     public void testCreateCorbaLongLong() {
         Long val = new Long(123456789);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("longlong"),
                                       CorbaConstants.NT_CORBA_LONGLONG,
                                       orb.get_primitive_tc(TCKind.tk_longlong),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -257,13 +255,13 @@
 
     public void testCreateCorbaULongLong() {
         Long val = new Long(987654321);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("ulonglong"),
                                       CorbaConstants.NT_CORBA_ULONGLONG,
                                       orb.get_primitive_tc(TCKind.tk_ulonglong),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -278,13 +276,13 @@
 
     public void testCreateCorbaFloat() {
         Float val = new Float(1234.56);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("float"),
                                       CorbaConstants.NT_CORBA_FLOAT,
                                       orb.get_primitive_tc(TCKind.tk_float),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -299,13 +297,13 @@
 
     public void testCreateCorbaDouble() {
         Double val = new Double(123456.789);
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("double"),
                                       CorbaConstants.NT_CORBA_DOUBLE,
                                       orb.get_primitive_tc(TCKind.tk_double),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.toString().equals(result));
@@ -320,13 +318,13 @@
 
     public void testCreateCorbaString() {
         String val = "Test String";
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("string"),
                                       CorbaConstants.NT_CORBA_STRING,
                                       orb.get_primitive_tc(TCKind.tk_string),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.equals(result));
@@ -341,13 +339,13 @@
 
     public void testCreateCorbaWString() {
         String val = "Test Wide String";
-        CorbaPrimitiveHandler obj =
+        CorbaPrimitiveHandler obj = 
             new CorbaPrimitiveHandler(new QName("wstring"),
                                       CorbaConstants.NT_CORBA_WSTRING,
                                       orb.get_primitive_tc(TCKind.tk_wstring),
                                       null);
         assertNotNull(obj);
-
+        
         obj.setValueFromData(val.toString());
         String result = obj.getValueData();
         assertTrue(val.equals(result));

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaSequenceHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaSequenceHandlerTest.java?view=diff&rev=483586&r1=483585&r2=483586
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaSequenceHandlerTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaSequenceHandlerTest.java
Thu Dec  7 10:11:27 2006
@@ -18,14 +18,12 @@
  */
 package org.apache.yoko.bindings.corba.types;
 
-import java.util.Properties;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
 
 import org.apache.schemas.yoko.bindings.corba.Sequence;
 import org.apache.yoko.wsdl.CorbaConstants;
-
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.TCKind;
 import org.omg.CORBA.TypeCode;
@@ -37,7 +35,7 @@
     private QName objName;
     private QName objIdlType;
     private TypeCode objTypeCode;
-
+    
     public CorbaSequenceHandlerTest(String arg0) {
         super(arg0);
     }
@@ -45,12 +43,11 @@
     public static void main(String[] args) {
         junit.textui.TestRunner.run(CorbaArrayHandlerTest.class);
     }
-
+    
     protected void setUp() throws Exception {
         super.setUp();
-
-        java.util.Properties props = new Properties();
-        props.putAll(System.getProperties());
+        
+        java.util.Properties props = System.getProperties();
         props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
         props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
         props.put("yoko.orb.id", "Yoko-Server-Binding");
@@ -60,7 +57,7 @@
         objIdlType = null;
         objTypeCode = null;
     }
-
+    
     protected void tearDown() throws Exception {
         if (orb != null) {
             try {

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaStructHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaStructHandlerTest.java?view=diff&rev=483586&r1=483585&r2=483586
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaStructHandlerTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaStructHandlerTest.java
Thu Dec  7 10:11:27 2006
@@ -18,7 +18,6 @@
  */
 package org.apache.yoko.bindings.corba.types;
 
-import java.util.Properties;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
@@ -32,31 +31,30 @@
 import org.omg.CORBA.TCKind;
 import org.omg.CORBA.TypeCode;
 
-// Since the exception handler is essentially the same as the struct handler (just included
in case
+// Since the exception handler is essentially the same as the struct handler (just included
in case 
 // structs and exceptions diverge at a later date), this test should cover both.
 public class CorbaStructHandlerTest extends TestCase {
 
     private ORB orb;
-
+    
     public CorbaStructHandlerTest(String arg0) {
         super(arg0);
     }
-
+    
     public static void main(String[] args) {
         junit.textui.TestRunner.run(CorbaObjectHandlerTest.class);
     }
-
+    
     protected void setUp() throws Exception {
         super.setUp();
-
-        java.util.Properties props = new Properties();
-        props.putAll(System.getProperties());
+        
+        java.util.Properties props = System.getProperties();
         props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
         props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
         props.put("yoko.orb.id", "Yoko-Server-Binding");
         orb = ORB.init(new String[0], props);
     }
-
+    
     protected void tearDown() throws Exception {
         if (orb != null) {
             try {
@@ -66,7 +64,7 @@
             }
         }
     }
-
+    
     public void testCorbaStructHandler() {
         Struct structType = new Struct();
         structType.setName("TestStruct");
@@ -77,31 +75,31 @@
         MemberType member1 = new MemberType();
         member1.setIdltype(CorbaConstants.NT_CORBA_STRING);
         member1.setName("member1");
-
+        
         QName structName = new QName("TestStruct");
-        QName structIdlType =
+        QName structIdlType = 
             new QName(CorbaConstants.NU_WSDL_CORBA, "testStruct", CorbaConstants.NP_WSDL_CORBA);
         StructMember[] structMembers = new StructMember[2];
-        structMembers[0] = new StructMember("member0",
+        structMembers[0] = new StructMember("member0", 
                                             orb.get_primitive_tc(TCKind.tk_long),
                                             null);
-        structMembers[1] = new StructMember("member1",
+        structMembers[1] = new StructMember("member1", 
                         orb.get_primitive_tc(TCKind.tk_string),
                         null);
-        TypeCode structTC = orb.create_struct_tc(structType.getRepositoryID(),
+        TypeCode structTC = orb.create_struct_tc(structType.getRepositoryID(), 
                                                  structType.getName(),
                                                  structMembers);
-
+        
         CorbaStructHandler obj = new CorbaStructHandler(structName, structIdlType, structTC,
structType);
         assertNotNull(obj);
-
+        
         CorbaPrimitiveHandler objMember0 = new CorbaPrimitiveHandler(new QName(member0.getName()),
                                                                      member0.getIdltype(),
                                                                      orb.get_primitive_tc(TCKind.tk_long),
                                                                      null);
         assertNotNull(objMember0);
         obj.addMember(objMember0);
-
+        
         CorbaPrimitiveHandler objMember1 = new CorbaPrimitiveHandler(new QName(member1.getName()),
                                                                      member1.getIdltype(),
                                                                      orb.get_primitive_tc(TCKind.tk_string),
@@ -111,19 +109,19 @@
 
         int memberSize = obj.getMembers().size();
         assertTrue(memberSize == 2);
-
+        
         QName nameResult = obj.getName();
         assertTrue(structName.equals(nameResult));
-
+        
         QName idlTypeResult = obj.getIdlType();
         assertTrue(structIdlType.equals(idlTypeResult));
-
+        
         CorbaObjectHandler member0Result = obj.getMemberByName("member0");
         assertNotNull(member0Result);
         assertTrue(member0Result.getName().equals(objMember0.getName()));
-
+        
         CorbaObjectHandler member1Result = obj.getMember(1);
         assertNotNull(member1Result);
-        assertTrue(member1Result.getName().equals(objMember1.getName()));
+        assertTrue(member1Result.getName().equals(objMember1.getName()));        
     }
 }

Added: incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl?view=auto&rev=483586
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl (added)
+++ incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl Thu Dec  7 10:11:27
2006
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Generated by <idltowsdl> Tool. Version 4.0.0 -->
+<definitions name="except" targetNamespace="http://schemas.apache.org/idl/except"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:corba="http://schemas.apache.org/yoko/bindings/corba"
+    xmlns:corbatm="http://schemas.apache.org/typemap/corba/except"
+    xmlns:tns="http://schemas.apache.org/idl/except"
+    xmlns:wsa="http://www.w3.org/2005/08/addressing"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsd1="http://schemas.apache.org/idltypes/except">
+    <corba:typeMapping targetNamespace="http://schemas.apache.org/typemap/corba/except">
+        <corba:exception name="BadRecord" repositoryID="IDL:BadRecord:1.0"
+            type="xsd1:BadRecord">
+            <corba:member idltype="corba:string" name="reason"/>
+            <corba:member idltype="corba:short" name="code"/>
+        </corba:exception>
+    </corba:typeMapping>
+    <types>
+        <schema targetNamespace="http://schemas.apache.org/idltypes/except"
+            xmlns="http://www.w3.org/2001/XMLSchema"
+            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+            <complexType name="BadRecord">
+                <sequence>
+                    <element name="reason" type="string"/>
+                    <element name="code" type="short"/>
+                </sequence>
+            </complexType>
+            <element name="ExceptionTest.review_data">
+                <complexType>
+                    <sequence>
+                        <element name="data" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="ExceptionTest.review_dataResult">
+                <complexType>
+                    <sequence>
+          </sequence>
+                </complexType>
+            </element>
+            <element name="BadRecord" type="xsd1:BadRecord"/>
+        </schema>
+    </types>
+    <message name="ExceptionTest.review_data">
+        <part element="xsd1:ExceptionTest.review_data" name="parameters"/>
+    </message>
+    <message name="ExceptionTest.review_dataResponse">
+        <part element="xsd1:ExceptionTest.review_dataResult" name="parameters"/>
+    </message>
+    <message name="BadRecord">
+        <part element="xsd1:BadRecord" name="exception"/>
+    </message>
+    <portType name="ExceptionTest">
+        <operation name="review_data">
+            <input message="tns:ExceptionTest.review_data" name="review_data"/>
+            <output message="tns:ExceptionTest.review_dataResponse"
+                name="review_dataResponse"/>
+            <fault message="tns:BadRecord" name="BadRecord"/>
+        </operation>
+    </portType>
+    <binding name="ExceptionTestCORBABinding" type="tns:ExceptionTest">
+        <corba:binding repositoryID="IDL:ExceptionTest:1.0"/>
+        <operation name="review_data">
+            <corba:operation name="review_data">
+                <corba:param idltype="corba:string" mode="in" name="data"/>
+                <corba:raises exception="corbatm:BadRecord"/>
+            </corba:operation>
+            <input name="review_data"/>
+            <output name="review_dataResponse"/>
+            <fault name="BadRecord"/>
+        </operation>
+      </binding>
+    <service name="ExceptionTestCORBAService">
+        <port name="ExceptionTestCORBAPort" binding="tns:ExceptionTestCORBABinding">
+          <corba:address location="corbaloc::localhost:40000/except"/>
+        </port>
+    </service>
+    
+</definitions>
\ No newline at end of file

Propchange: incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/yoko/trunk/bindings/src/test/resources/wsdl/exceptions.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message