QName objName = new QName("object");
QName objIdlType = new QName(staxTestNamespaceURI, "TestStruct", staxTestPrefix);
CorbaTypeImpl type = CorbaUtils.getCorbaType(objIdlType, staxObject.getTypeMaps());
assertTrue(type instanceof Struct);
Struct structType = (Struct)type;
TypeCode objTypeCode = CorbaUtils.getTypeCode(orb, objIdlType, staxObject.getTypeMaps());
CorbaStructHandler obj = new CorbaStructHandler(objName, objIdlType, objTypeCode, structType);
assertNotNull(obj);
List<MemberType> structMembers = structType.getMember();
// For this test, we know what each of the members are. Create the correct handler and assign
// each member a value
MemberType m1 = structMembers.get(0);
TypeCode m1TypeCode = CorbaUtils.getTypeCode(orb, m1.getIdltype(), staxObject.getTypeMaps());
CorbaPrimitiveHandler member1 = new CorbaPrimitiveHandler(new QName(m1.getName()),
m1.getIdltype(),
m1TypeCode,
null);
Boolean member1Value = new Boolean(false);
member1.setValue(member1Value);
obj.addMember(member1);
MemberType m2 = structMembers.get(1);
TypeCode m2TypeCode = CorbaUtils.getTypeCode(orb, m2.getIdltype(), staxObject.getTypeMaps());
CorbaPrimitiveHandler member2 = new CorbaPrimitiveHandler(new QName(m2.getName()),
m2.getIdltype(),
m2TypeCode,
null);
String member2Value = "Member 2 string";
member2.setValue(member2Value);
obj.addMember(member2);
MemberType m3 = structMembers.get(2);
TypeCode m3TypeCode = CorbaUtils.getTypeCode(orb, m3.getIdltype(), staxObject.getTypeMaps());
CorbaPrimitiveHandler member3 = new CorbaPrimitiveHandler(new QName(m3.getName()),
m3.getIdltype(),
m3TypeCode,
null);
Float member3Value = new Float(12345.678);