Search in sources :

Example 21 with TypeCode

use of org.omg.CORBA.TypeCode in project cxf by apache.

the class CorbaObjectHandlerTest method testCreateCorbaObjectHandler.

@Test
public void testCreateCorbaObjectHandler() {
    QName objName = new QName("object");
    QName objIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "long", CorbaConstants.NP_WSDL_CORBA);
    TypeCode objTypeCode = orb.get_primitive_tc(TCKind.tk_long);
    CorbaObjectHandler obj = new CorbaObjectHandler(objName, objIdlType, objTypeCode, null);
    assertNotNull(obj);
}
Also used : TypeCode(org.omg.CORBA.TypeCode) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 22 with TypeCode

use of org.omg.CORBA.TypeCode in project cxf by apache.

the class CorbaSequenceHandlerTest method testCorbaSequenceHandler.

@Test
public void testCorbaSequenceHandler() {
    objName = new QName("object");
    objIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "sequenceType", CorbaConstants.NP_WSDL_CORBA);
    objTypeCode = orb.create_sequence_tc(5, orb.get_primitive_tc(TCKind.tk_long));
    Sequence sequenceType = new Sequence();
    sequenceType.setName("sequenceType");
    sequenceType.setElemtype(CorbaConstants.NT_CORBA_LONG);
    sequenceType.setBound(5);
    sequenceType.setRepositoryID("IDL:SequenceType:1.0");
    obj = new CorbaSequenceHandler(objName, objIdlType, objTypeCode, sequenceType);
    assertNotNull(obj);
    int[] sequenceData = { 2, 4, 6, 8, 10 };
    for (int i = 0; i < sequenceData.length; ++i) {
        QName elName = new QName("item");
        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(Integer.valueOf(sequenceData[i]));
        obj.addElement(el);
    }
    QName nameResult = obj.getName();
    assertNotNull(nameResult);
    assertTrue(objName.equals(nameResult));
    QName idlTypeResult = obj.getIdlType();
    assertNotNull(idlTypeResult);
    assertTrue(idlTypeResult.equals(objIdlType));
    TypeCode tcResult = obj.getTypeCode();
    assertNotNull(tcResult);
    assertTrue(tcResult.kind().value() == objTypeCode.kind().value());
    Object objDefResult = obj.getType();
    assertNotNull(objDefResult);
    assertTrue(objDefResult instanceof Sequence);
    int countResult = obj.getNumberOfElements();
    for (int i = 0; i < countResult; ++i) {
        CorbaObjectHandler elResult = obj.getElement(i);
        assertNotNull(elResult);
    }
}
Also used : TypeCode(org.omg.CORBA.TypeCode) QName(javax.xml.namespace.QName) Sequence(org.apache.cxf.binding.corba.wsdl.Sequence) Test(org.junit.Test)

Example 23 with TypeCode

use of org.omg.CORBA.TypeCode in project cxf by apache.

the class CorbaUtilsTest method testStringTypeCode.

@Test
public void testStringTypeCode() {
    QName type = new QName(CorbaConstants.NU_WSDL_CORBA, "string", "corba");
    TypeCode tc = CorbaUtils.getPrimitiveTypeCode(orb, type);
    assertNotNull(tc);
    assertTrue(tc.kind().value() == TCKind._tk_string);
    assertTrue(CorbaUtils.isPrimitiveIdlType(type));
}
Also used : TypeCode(org.omg.CORBA.TypeCode) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 24 with TypeCode

use of org.omg.CORBA.TypeCode in project cxf by apache.

the class CorbaUtilsTest method testWStringTypeCode.

@Test
public void testWStringTypeCode() {
    QName type = new QName(CorbaConstants.NU_WSDL_CORBA, "wstring", "corba");
    TypeCode tc = CorbaUtils.getPrimitiveTypeCode(orb, type);
    assertNotNull(tc);
    assertTrue(tc.kind().value() == TCKind._tk_wstring);
    assertTrue(CorbaUtils.isPrimitiveIdlType(type));
}
Also used : TypeCode(org.omg.CORBA.TypeCode) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 25 with TypeCode

use of org.omg.CORBA.TypeCode in project cxf by apache.

the class CorbaUtilsTest method testBooleanTypeCode.

@Test
public void testBooleanTypeCode() {
    QName type = new QName(CorbaConstants.NU_WSDL_CORBA, "boolean", "corba");
    TypeCode tc = CorbaUtils.getPrimitiveTypeCode(orb, type);
    assertNotNull(tc);
    assertTrue(tc.kind().value() == TCKind._tk_boolean);
    assertTrue(CorbaUtils.isPrimitiveIdlType(type));
}
Also used : TypeCode(org.omg.CORBA.TypeCode) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Aggregations

TypeCode (org.omg.CORBA.TypeCode)69 QName (javax.xml.namespace.QName)49 Test (org.junit.Test)44 CorbaPrimitiveHandler (org.apache.cxf.binding.corba.types.CorbaPrimitiveHandler)18 InputStream (org.omg.CORBA.portable.InputStream)15 OutputStream (org.omg.CORBA.portable.OutputStream)14 StructMember (org.omg.CORBA.StructMember)9 CorbaBindingException (org.apache.cxf.binding.corba.CorbaBindingException)6 MemberType (org.apache.cxf.binding.corba.wsdl.MemberType)6 Any (org.omg.CORBA.Any)6 NVList (org.omg.CORBA.NVList)6 CorbaStreamable (org.apache.cxf.binding.corba.CorbaStreamable)5 CorbaObjectHandler (org.apache.cxf.binding.corba.types.CorbaObjectHandler)4 Array (org.apache.cxf.binding.corba.wsdl.Array)4 Enum (org.apache.cxf.binding.corba.wsdl.Enum)4 Enumerator (org.apache.cxf.binding.corba.wsdl.Enumerator)4 Sequence (org.apache.cxf.binding.corba.wsdl.Sequence)4 Struct (org.apache.cxf.binding.corba.wsdl.Struct)4 IOException (java.io.IOException)3 Alias (org.apache.cxf.binding.corba.wsdl.Alias)3