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);
}
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);
}
}
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));
}
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));
}
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));
}
Aggregations