try
{
int i;
Any any = orb.create_any();
Any av;
DynAny d1;
DynAny d2;
DynAny copy;
String str;
String wstr;
DynStruct s1;
DynStruct s2;
String cp;
TypeCode type;
TypeCode tc;
TestStruct ts = new TestStruct();
TestStruct pts;
NameValuePair[] nvpseq;
NameDynAnyPair[] ndpseq;
type = TestStructHelper.type();
d1 = factory.create_dyn_any_from_type_code(type);
s1 = DynStructHelper.narrow(d1);
//
// Test: current_member_name, current_member_kind
//
str = s1.current_member_name();
TEST(str.equals("shortVal"));
TEST(s1.current_member_kind() == TCKind.tk_short);
s1.next();
str = s1.current_member_name();
TEST(str.equals("ushortVal"));
TEST(s1.current_member_kind() == TCKind.tk_ushort);
s1.next();
str = s1.current_member_name();
TEST(str.equals("longVal"));
TEST(s1.current_member_kind() == TCKind.tk_long);
s1.next();
str = s1.current_member_name();
TEST(str.equals("ulongVal"));
TEST(s1.current_member_kind() == TCKind.tk_ulong);
s1.next();
str = s1.current_member_name();
TEST(str.equals("floatVal"));
TEST(s1.current_member_kind() == TCKind.tk_float);
s1.next();
str = s1.current_member_name();
TEST(str.equals("doubleVal"));
TEST(s1.current_member_kind() == TCKind.tk_double);
s1.next();
str = s1.current_member_name();
TEST(str.equals("boolVal"));
TEST(s1.current_member_kind() == TCKind.tk_boolean);
s1.next();
str = s1.current_member_name();
TEST(str.equals("charVal"));
TEST(s1.current_member_kind() == TCKind.tk_char);
s1.next();
str = s1.current_member_name();
TEST(str.equals("octetVal"));
TEST(s1.current_member_kind() == TCKind.tk_octet);
s1.next();
str = s1.current_member_name();
TEST(str.equals("anyVal"));
TEST(s1.current_member_kind() == TCKind.tk_any);
s1.next();
str = s1.current_member_name();
TEST(str.equals("tcVal"));
TEST(s1.current_member_kind() == TCKind.tk_TypeCode);
s1.next();
str = s1.current_member_name();
TEST(str.equals("objectVal"));
TEST(s1.current_member_kind() == TCKind.tk_objref);
s1.next();
str = s1.current_member_name();
TEST(str.equals("stringVal"));
TEST(s1.current_member_kind() == TCKind.tk_string);
s1.next();
str = s1.current_member_name();
TEST(str.equals("longlongVal"));
TEST(s1.current_member_kind() == TCKind.tk_longlong);
s1.next();
str = s1.current_member_name();
TEST(str.equals("ulonglongVal"));
TEST(s1.current_member_kind() == TCKind.tk_ulonglong);
s1.next();
str = s1.current_member_name();
TEST(str.equals("wcharVal"));
TEST(s1.current_member_kind() == TCKind.tk_wchar);
s1.next();
str = s1.current_member_name();
TEST(str.equals("wstringVal"));
TEST(s1.current_member_kind() == TCKind.tk_wstring);
//
// Test: insert values into members
//
s1.rewind();
s1.insert_short(SHORT_VALUE);
s1.next();
s1.insert_ushort(USHORT_VALUE);
s1.next();
s1.insert_long(LONG_VALUE);
s1.next();
s1.insert_ulong(ULONG_VALUE);
s1.next();
s1.insert_float(FLOAT_VALUE);
s1.next();
s1.insert_double(DOUBLE_VALUE);
s1.next();
s1.insert_boolean(BOOLEAN_VALUE);
s1.next();
s1.insert_char(CHAR_VALUE);
s1.next();
s1.insert_octet(OCTET_VALUE);
s1.next();
DynAny d1c = d1.current_component();
any.insert_string(ANY_VALUE);
s1.insert_any(any);
s1.next();
s1.insert_typecode(TYPECODE_VALUE);
s1.next();
s1.insert_reference(null);
s1.next();
s1.insert_string(STRING_VALUE);
s1.next();
s1.insert_longlong(LONGLONG_VALUE);
s1.next();
s1.insert_ulonglong(ULONGLONG_VALUE);
s1.next();
s1.insert_wchar(WCHAR_VALUE);
s1.next();
s1.insert_wstring(WSTRING_VALUE);
s1.next();
//
// Test: get values from members
//
s1.rewind();
TEST(s1.get_short() == SHORT_VALUE);
s1.next();
TEST(s1.get_ushort() == USHORT_VALUE);
s1.next();
TEST(s1.get_long() == LONG_VALUE);
s1.next();
TEST(s1.get_ulong() == ULONG_VALUE);
s1.next();
TEST(s1.get_float() == FLOAT_VALUE);
s1.next();
TEST(s1.get_double() == DOUBLE_VALUE);
s1.next();
TEST(s1.get_boolean() == BOOLEAN_VALUE);
s1.next();
TEST(s1.get_char() == CHAR_VALUE);
s1.next();
TEST(s1.get_octet() == OCTET_VALUE);
s1.next();
av = s1.get_any();
TEST(av.extract_string().equals(ANY_VALUE));
s1.next();
tc = s1.get_typecode();
s1.next();
TEST(tc.equal(TYPECODE_VALUE));
TEST(s1.get_reference() == null);
s1.next();
str = s1.get_string();
s1.next();
TEST(str.equals(STRING_VALUE));
TEST(s1.get_longlong() == LONGLONG_VALUE);
s1.next();
TEST(s1.get_ulonglong() == ULONGLONG_VALUE);
s1.next();
TEST(s1.get_wchar() == WCHAR_VALUE);
s1.next();
wstr = s1.get_wstring();
s1.next();
TEST(wstr.equals(WSTRING_VALUE));
//
// Test: get_members
//
nvpseq = s1.get_members();
s1.rewind();
for (i = 0; i < 11; i++)
{
str = s1.current_member_name();
TEST(str.equals(nvpseq [ i ].id));
DynAny dv = factory.create_dyn_any(nvpseq [ i ].value);
DynAny comp = s1.current_component();
TEST(dv.equal(comp));
dv.destroy();
s1.next();
}