discriminator = orb.get_primitive_tc (TCKind.from_int (3));
members = new UnionMember [2];
members[0] = new UnionMember ("UnionMember1", label, testTC, null);
label = orb.create_any();
label.insert_long(321);
members[1] = new UnionMember ("UnionMember2", label, testTC, null);
/* Test valid name */
orb.create_union_tc (id, name, discriminator, members);
/* Test blank name */
members[0] = new UnionMember ("", label, testTC, null);
label = orb.create_any();
label.insert_long(123);
members[1] = new UnionMember ("Member2", label, testTC, null);
try
{
orb.create_union_tc (id, name, discriminator, members);
fail("Excepted exception blank member name in create_union_tc");
}
catch (BAD_PARAM ex)
{
// Do nothing - expecting exception}
}
/* Test null name */
members[0] = new UnionMember ("Member1", label, testTC, null);
label = orb.create_any();
label.insert_long (321);
members[1] = new UnionMember (null, label, testTC, null);
try
{
orb.create_union_tc (id, name, discriminator, members);