2 #include "ace/Get_Opt.h"
6 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT ("k:"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
22 ACE_ERROR_RETURN ((LM_ERROR
,
23 ACE_TEXT ("usage: %s ")
33 call_method (::Test::A_ptr server
,
34 ::Test::A::FailOn where
,
36 ::CORBA::String_out
& arg2
,
38 const char * error_message
)
42 CORBA::String_var res
= server
->method (where
,
52 catch (const CORBA::BAD_PARAM
&)
56 catch (const CORBA::Exception
&)
68 call_method_s (::Test::A_ptr server
,
69 ::Test::A::FailOn where
,
71 ::CORBA::String_out
& arg2
,
73 const char * error_message
)
77 CORBA::String_var res
= server
->method_s (where
,
87 catch (const CORBA::BAD_PARAM
&)
91 catch (const CORBA::Exception
&)
103 call_seq_method (::Test::A_ptr server
,
104 ::Test::A::FailOn where
,
105 const ::Test::seq_bd_str
& arg1
,
106 ::Test::seq_bd_str_out
& arg2
,
107 ::Test::seq_bd_str
& arg3
,
108 const char * error_message
)
112 ::Test::seq_bd_str_var res
=
113 server
->seq_method (where
,
118 ACE_ERROR ((LM_ERROR
,
123 catch (const CORBA::BAD_PARAM
&)
127 catch (const CORBA::Exception
&)
129 ACE_ERROR ((LM_ERROR
,
139 call_seq_method_s (::Test::A_ptr server
,
140 ::Test::A::FailOn where
,
141 const ::Test::seq_bds_str
& arg1
,
142 ::Test::seq_bds_str_out
& arg2
,
143 ::Test::seq_bds_str
& arg3
,
144 const char * error_message
)
148 ::Test::seq_bds_str_var res
=
149 server
->seq_method_s (where
,
154 ACE_ERROR ((LM_ERROR
,
159 catch (const CORBA::BAD_PARAM
&)
163 catch (const CORBA::Exception
&)
165 ACE_ERROR ((LM_ERROR
,
175 call_arr_method (::Test::A_ptr server
,
176 ::Test::A::FailOn where
,
177 const ::Test::arr_bd_str
& arg1
,
178 ::Test::arr_bd_str_out
& arg2
,
179 ::Test::arr_bd_str
& arg3
,
180 const char * error_message
)
184 ::Test::arr_bd_str_var res
=
185 server
->arr_method (where
,
190 ACE_ERROR ((LM_ERROR
,
195 catch (const CORBA::BAD_PARAM
&)
199 catch (const CORBA::Exception
&)
201 ACE_ERROR ((LM_ERROR
,
211 call_arr_method_s (::Test::A_ptr server
,
212 ::Test::A::FailOn where
,
213 const ::Test::arr_bds_str
& arg1
,
214 ::Test::arr_bds_str_out
& arg2
,
215 ::Test::arr_bds_str
& arg3
,
216 const char * error_message
)
220 ::Test::arr_bds_str_var res
=
221 server
->arr_method_s (where
,
226 ACE_ERROR ((LM_ERROR
,
231 catch (const CORBA::BAD_PARAM
&)
235 catch (const CORBA::Exception
&)
237 ACE_ERROR ((LM_ERROR
,
247 call_sct_method (::Test::A_ptr server
,
248 ::Test::A::FailOn where
,
249 const ::Test::sct
& arg1
,
250 ::Test::sct_out
& arg2
,
252 const char * error_message
)
256 ::Test::sct_var res
=
257 server
->sct_method (where
,
262 ACE_ERROR ((LM_ERROR
,
267 catch (const CORBA::BAD_PARAM
&)
271 catch (const CORBA::Exception
&)
273 ACE_ERROR ((LM_ERROR
,
283 call_unn_method (::Test::A_ptr server
,
284 ::Test::A::FailOn where
,
285 const ::Test::unn
& arg1
,
286 ::Test::unn_out
& arg2
,
288 const char * error_message
)
292 ::Test::unn_var res
=
293 server
->unn_method (where
,
298 ACE_ERROR ((LM_ERROR
,
303 catch (const CORBA::BAD_PARAM
&)
307 catch (const CORBA::Exception
&)
309 ACE_ERROR ((LM_ERROR
,
319 call_vbx_method (::Test::A_ptr server
,
320 ::Test::A::FailOn where
,
321 ::Test::val_bd_str
* arg1
,
322 ::Test::val_bd_str_out arg2
,
323 ::Test::val_bd_str
*& arg3
,
324 const char * error_message
)
328 ::Test::val_bd_str_var res
=
329 server
->vbx_method (where
,
334 ACE_ERROR ((LM_ERROR
,
339 catch (const CORBA::BAD_PARAM
&)
343 catch (const CORBA::Exception
&)
345 ACE_ERROR ((LM_ERROR
,
355 call_vbx_method_s (::Test::A_ptr server
,
356 ::Test::A::FailOn where
,
357 ::Test::val_bds_str
* arg1
,
358 ::Test::val_bds_str_out arg2
,
359 ::Test::val_bds_str
*& arg3
,
360 const char * error_message
)
364 ::Test::val_bds_str_var res
=
365 server
->vbx_method_s (where
,
370 ACE_ERROR ((LM_ERROR
,
375 catch (const CORBA::BAD_PARAM
&)
379 catch (const CORBA::Exception
&)
381 ACE_ERROR ((LM_ERROR
,
391 call_vtp_method (::Test::A_ptr server
,
392 ::Test::A::FailOn where
,
394 ::Test::vtp_out arg2
,
396 const char * error_message
)
400 ::Test::vtp_var res
=
401 server
->vtp_method (where
,
406 ACE_ERROR ((LM_ERROR
,
411 catch (const CORBA::BAD_PARAM
&)
415 catch (const CORBA::Exception
&)
417 ACE_ERROR ((LM_ERROR
,
426 int test_strings (::Test::A_ptr server
)
431 CORBA::String_var arg2
, arg3
;
432 CORBA::String_out arg2_out
= arg2
.out ();
439 "exception is thrown in a call "
440 "for `in bounded_string`.\n");
442 call_method_s (server
,
447 "exception is thrown in a call "
448 "for `in string<BOUND>`.\n");
452 CORBA::String_var arg2
, arg3
;
453 CORBA::String_out arg2_out
= arg2
.out ();
460 "exception is thrown in a call "
461 "for `out bounded_string`.\n");
463 call_method_s (server
,
468 "exception is thrown in a call "
469 "for `out string<BOUND>`.\n");
473 CORBA::String_var arg2
, arg3
;
474 CORBA::String_out arg2_out
= arg2
.out ();
481 "exception is thrown in a call "
482 "for `inout bounded_string` (server side).\n");
484 call_method_s (server
,
489 "exception is thrown in a call "
490 "for `inout string<BOUND>` (server side).\n");
494 CORBA::String_var arg2
;
495 CORBA::String_var arg3
= CORBA::string_dup (::Test::FailStr
);
496 CORBA::String_out arg2_out
= arg2
.out ();
503 "exception is thrown in a call "
504 "for `inout bounded_string`.\n");
506 call_method_s (server
,
511 "exception is thrown in a call "
512 "for `inout string<BOUND>`.\n");
516 CORBA::String_var arg2
, arg3
;
517 CORBA::String_out arg2_out
= arg2
.out ();
524 "exception is thrown in a call "
525 "when server returns `bounded_string`.\n");
527 call_method_s (server
,
532 "exception is thrown in a call "
533 "when server returns `string<BOUND>`.\n");
539 int test_sequences (::Test::A_ptr server
)
544 ::Test::seq_bd_str arg1
;
546 arg1
[0] = CORBA::string_dup (::Test::FailStr
);
547 ::Test::seq_bd_str_var arg2
;
548 ::Test::seq_bd_str_out arg2_out
= arg2
.out ();
549 ::Test::seq_bd_str arg3
;
551 call_seq_method (server
,
556 "exception is thrown in a call "
557 "for `in sequence<bounded_string>`.\n");
561 ::Test::seq_bds_str arg1
;
563 arg1
[0] = CORBA::string_dup (::Test::FailStr
);
564 ::Test::seq_bds_str_var arg2
;
565 ::Test::seq_bds_str_out arg2_out
= arg2
.out ();
566 ::Test::seq_bds_str arg3
;
569 call_seq_method_s (server
,
574 "exception is thrown in a call "
575 "for `in sequence<string<BOUND>>`.\n");
579 ::Test::seq_bd_str arg1
;
581 ::Test::seq_bd_str_var arg2
;
582 ::Test::seq_bd_str_out arg2_out
= arg2
.out ();
583 ::Test::seq_bd_str arg3
;
586 call_seq_method (server
,
591 "exception is thrown in a call "
592 "for `out sequence<bounded_string>`.\n");
596 ::Test::seq_bds_str arg1
;
598 ::Test::seq_bds_str_var arg2
;
599 ::Test::seq_bds_str_out arg2_out
= arg2
.out ();
600 ::Test::seq_bds_str arg3
;
603 call_seq_method_s (server
,
608 "exception is thrown in a call "
609 "for `out sequence<string<BOUND>>`.\n");
613 ::Test::seq_bd_str arg1
;
615 ::Test::seq_bd_str_var arg2
;
616 ::Test::seq_bd_str_out arg2_out
= arg2
.out ();
617 ::Test::seq_bd_str arg3
;
620 call_seq_method (server
,
625 "exception is thrown in a call "
626 "for `inout sequence<bounded_string>` (server side).\n");
630 ::Test::seq_bds_str arg1
;
632 ::Test::seq_bds_str_var arg2
;
633 ::Test::seq_bds_str_out arg2_out
= arg2
.out ();
634 ::Test::seq_bds_str arg3
;
637 call_seq_method_s (server
,
642 "exception is thrown in a call "
643 "for `inout sequence<string<BOUND>>` (server side).\n");
647 ::Test::seq_bd_str arg1
;
649 ::Test::seq_bd_str_var arg2
;
650 ::Test::seq_bd_str_out arg2_out
= arg2
.out ();
651 ::Test::seq_bd_str arg3
;
653 arg3
[0] = CORBA::string_dup (::Test::FailStr
);
655 call_seq_method (server
,
660 "exception is thrown in a call "
661 "for `inout sequence<bounded_string>`.\n");
665 ::Test::seq_bds_str arg1
;
667 ::Test::seq_bds_str_var arg2
;
668 ::Test::seq_bds_str_out arg2_out
= arg2
.out ();
669 ::Test::seq_bds_str arg3
;
671 arg3
[0] = CORBA::string_dup (::Test::FailStr
);
673 call_seq_method_s (server
,
678 "exception is thrown in a call "
679 "for `inout sequence<string<BOUND>>`.\n");
683 ::Test::seq_bd_str arg1
;
685 ::Test::seq_bd_str_var arg2
;
686 ::Test::seq_bd_str_out arg2_out
= arg2
.out ();
687 ::Test::seq_bd_str arg3
;
690 call_seq_method (server
,
695 "exception is thrown in a call "
696 "when server returns `sequence<bounded_string>`.\n");
700 ::Test::seq_bds_str arg1
;
702 ::Test::seq_bds_str_var arg2
;
703 ::Test::seq_bds_str_out arg2_out
= arg2
.out ();
704 ::Test::seq_bds_str arg3
;
707 call_seq_method_s (server
,
712 "exception is thrown in a call "
713 "when server returns `sequence<string<BOUND>>`.\n");
719 int test_arrays (::Test::A_ptr server
)
724 ::Test::arr_bd_str arg1
;
725 arg1
[0] = CORBA::string_dup (::Test::FailStr
);
726 ::Test::arr_bd_str_var arg2
;
727 ::Test::arr_bd_str_out arg2_out
= arg2
.out ();
728 ::Test::arr_bd_str arg3
;
730 call_arr_method (server
,
735 "exception is thrown in a call "
736 "for `in bounded_string array[]`.\n");
740 ::Test::arr_bds_str arg1
;
741 arg1
[0] = CORBA::string_dup (::Test::FailStr
);
742 ::Test::arr_bds_str_var arg2
;
743 ::Test::arr_bds_str_out arg2_out
= arg2
.out ();
744 ::Test::arr_bds_str arg3
;
746 call_arr_method_s (server
,
751 "exception is thrown in a call "
752 "for `in string<BOUND> array[]`.\n");
756 ::Test::arr_bd_str arg1
;
757 ::Test::arr_bd_str_var arg2
;
758 ::Test::arr_bd_str_out arg2_out
= arg2
.out ();
759 ::Test::arr_bd_str arg3
;
761 call_arr_method (server
,
766 "exception is thrown in a call "
767 "for `out bounded_string array[]`.\n");
771 ::Test::arr_bds_str arg1
;
772 ::Test::arr_bds_str_var arg2
;
773 ::Test::arr_bds_str_out arg2_out
= arg2
.out ();
774 ::Test::arr_bds_str arg3
;
776 call_arr_method_s (server
,
781 "exception is thrown in a call "
782 "for `out string<BOUND> array[]`.\n");
786 ::Test::arr_bd_str arg1
;
787 ::Test::arr_bd_str_var arg2
;
788 ::Test::arr_bd_str_out arg2_out
= arg2
.out ();
789 ::Test::arr_bd_str arg3
;
791 call_arr_method (server
,
796 "exception is thrown in a call "
797 "for `inout bounded_string array[]` (server side).\n");
801 ::Test::arr_bds_str arg1
;
802 ::Test::arr_bds_str_var arg2
;
803 ::Test::arr_bds_str_out arg2_out
= arg2
.out ();
804 ::Test::arr_bds_str arg3
;
806 call_arr_method_s (server
,
811 "exception is thrown in a call "
812 "for `inout string<BOUND> array[]` (server side).\n");
816 ::Test::arr_bd_str arg1
;
817 ::Test::arr_bd_str_var arg2
;
818 ::Test::arr_bd_str_out arg2_out
= arg2
.out ();
819 ::Test::arr_bd_str arg3
;
820 arg3
[0] = CORBA::string_dup (::Test::FailStr
);
822 call_arr_method (server
,
827 "exception is thrown in a call "
828 "for `inout bounded_string array[]`.\n");
832 ::Test::arr_bds_str arg1
;
833 ::Test::arr_bds_str_var arg2
;
834 ::Test::arr_bds_str_out arg2_out
= arg2
.out ();
835 ::Test::arr_bds_str arg3
;
836 arg3
[0] = CORBA::string_dup (::Test::FailStr
);
838 call_arr_method_s (server
,
843 "exception is thrown in a call "
844 "for `inout string<BOUND> array[]`.\n");
848 ::Test::arr_bd_str arg1
;
849 ::Test::arr_bd_str_var arg2
;
850 ::Test::arr_bd_str_out arg2_out
= arg2
.out ();
851 ::Test::arr_bd_str arg3
;
853 call_arr_method (server
,
858 "exception is thrown in a call "
859 "when server returns `bounded_string array[]`.\n");
863 ::Test::arr_bds_str arg1
;
864 ::Test::arr_bds_str_var arg2
;
865 ::Test::arr_bds_str_out arg2_out
= arg2
.out ();
866 ::Test::arr_bds_str arg3
;
868 call_arr_method_s (server
,
873 "exception is thrown in a call "
874 "when server returns `string<BOUND> array[]`.\n");
880 int test_structs (::Test::A_ptr server
)
886 arg1
.b
= CORBA::string_dup (::Test::FailStr
);
887 arg1
.c
= CORBA::string_dup (::Test::FailStr
);
888 ::Test::sct_var arg2
;
889 ::Test::sct_out arg2_out
= arg2
.out ();
892 call_sct_method (server
,
897 "exception is thrown in a call "
898 "for `in struct {}`.\n");
903 ::Test::sct_var arg2
;
904 ::Test::sct_out arg2_out
= arg2
.out ();
907 call_sct_method (server
,
912 "exception is thrown in a call "
913 "for `out struct {}`.\n");
918 ::Test::sct_var arg2
;
919 ::Test::sct_out arg2_out
= arg2
.out ();
922 call_sct_method (server
,
927 "exception is thrown in a call "
928 "for `inout struct {}` (server side).\n");
933 ::Test::sct_var arg2
;
934 ::Test::sct_out arg2_out
= arg2
.out ();
936 arg3
.b
= CORBA::string_dup (::Test::FailStr
);
937 arg3
.c
= CORBA::string_dup (::Test::FailStr
);
939 call_sct_method (server
,
944 "exception is thrown in a call "
945 "for `inout struct {}`.\n");
950 ::Test::sct_var arg2
;
951 ::Test::sct_out arg2_out
= arg2
.out ();
954 call_sct_method (server
,
959 "exception is thrown in a call "
960 "when server returns `struct {}`.\n");
966 int test_unions (::Test::A_ptr server
)
972 arg1
.b (CORBA::string_dup (::Test::FailStr
));
973 arg1
.c (CORBA::string_dup (::Test::FailStr
));
974 ::Test::unn_var arg2
;
975 ::Test::unn_out arg2_out
= arg2
.out ();
978 call_unn_method (server
,
983 "exception is thrown in a call "
984 "for `in union {}`.\n");
989 ::Test::unn_var arg2
;
990 ::Test::unn_out arg2_out
= arg2
.out ();
993 call_unn_method (server
,
998 "exception is thrown in a call "
999 "for `out union {}`.\n");
1004 ::Test::unn_var arg2
;
1005 ::Test::unn_out arg2_out
= arg2
.out ();
1008 call_unn_method (server
,
1013 "exception is thrown in a call "
1014 "for `inout union {}` (server side).\n");
1019 ::Test::unn_var arg2
;
1020 ::Test::unn_out arg2_out
= arg2
.out ();
1022 arg3
.b (CORBA::string_dup (::Test::FailStr
));
1023 arg3
.c (CORBA::string_dup (::Test::FailStr
));
1025 call_unn_method (server
,
1030 "exception is thrown in a call "
1031 "for `inout union {}`.\n");
1036 ::Test::unn_var arg2
;
1037 ::Test::unn_out arg2_out
= arg2
.out ();
1040 call_unn_method (server
,
1045 "exception is thrown in a call when "
1046 "when server returns `union {}`.\n");
1052 int test_valueboxes (::Test::A_ptr server
)
1057 ::Test::val_bd_str_var arg1
;
1058 ACE_NEW_THROW_EX (arg1
.inout (),
1059 ::Test::val_bd_str (::Test::FailStr
),
1060 CORBA::NO_MEMORY ());
1061 ::Test::val_bd_str_var arg2
;
1062 ::Test::val_bd_str_out arg2_out
= arg2
;
1063 ::Test::val_bd_str_var arg3
;
1065 call_vbx_method (server
,
1070 "exception is thrown in a call "
1071 "for `in valuebox {bounded_string}`.\n");
1075 ::Test::val_bds_str_var arg1
;
1076 ACE_NEW_THROW_EX (arg1
.inout (),
1077 ::Test::val_bds_str (::Test::FailStr
),
1078 CORBA::NO_MEMORY ());
1079 ::Test::val_bds_str_var arg2
;
1080 ::Test::val_bds_str_out arg2_out
= arg2
;
1081 ::Test::val_bds_str_var arg3
;
1083 call_vbx_method_s (server
,
1088 "exception is thrown in a call "
1089 "for `in valuebox {string<BOUND>}`.\n");
1093 ::Test::val_bd_str_var arg1
;
1094 ::Test::val_bd_str_var arg2
;
1095 ::Test::val_bd_str_out arg2_out
= arg2
;
1096 ::Test::val_bd_str_var arg3
;
1098 call_vbx_method (server
,
1103 "exception is thrown in a call "
1104 "for `out valuebox {bounded_string}`.\n");
1108 ::Test::val_bds_str_var arg1
;
1109 ::Test::val_bds_str_var arg2
;
1110 ::Test::val_bds_str_out arg2_out
= arg2
;
1111 ::Test::val_bds_str_var arg3
;
1113 call_vbx_method_s (server
,
1118 "exception is thrown in a call "
1119 "for `out valuebox {string<BOUND>}`.\n");
1123 ::Test::val_bd_str_var arg1
;
1124 ::Test::val_bd_str_var arg2
;
1125 ::Test::val_bd_str_out arg2_out
= arg2
;
1126 ::Test::val_bd_str_var arg3
;
1128 call_vbx_method (server
,
1133 "exception is thrown in a call "
1134 "for `inout valuebox {bounded_string}` (server side).\n");
1138 ::Test::val_bds_str_var arg1
;
1139 ::Test::val_bds_str_var arg2
;
1140 ::Test::val_bds_str_out arg2_out
= arg2
;
1141 ::Test::val_bds_str_var arg3
;
1143 call_vbx_method_s (server
,
1148 "exception is thrown in a call "
1149 "for `inout valuebox {string<BOUND>}` (server side).\n");
1153 ::Test::val_bd_str_var arg1
;
1154 ::Test::val_bd_str_var arg2
;
1155 ::Test::val_bd_str_out arg2_out
= arg2
;
1156 ::Test::val_bd_str_var arg3
;
1157 ACE_NEW_THROW_EX (arg3
.inout (),
1158 ::Test::val_bd_str (::Test::FailStr
),
1159 CORBA::NO_MEMORY ());
1161 call_vbx_method (server
,
1166 "exception is thrown in a call "
1167 "for `inout valuebox {bounded_string}`.\n");
1171 ::Test::val_bds_str_var arg1
;
1172 ::Test::val_bds_str_var arg2
;
1173 ::Test::val_bds_str_out arg2_out
= arg2
;
1174 ::Test::val_bds_str_var arg3
;
1175 ACE_NEW_THROW_EX (arg3
.inout (),
1176 ::Test::val_bds_str (::Test::FailStr
),
1177 CORBA::NO_MEMORY ());
1179 call_vbx_method_s (server
,
1184 "exception is thrown in a call "
1185 "for `inout valuebox {string<BOUND>}`.\n");
1189 ::Test::val_bd_str_var arg1
;
1190 ::Test::val_bd_str_var arg2
;
1191 ::Test::val_bd_str_out arg2_out
= arg2
;
1192 ::Test::val_bd_str_var arg3
;
1194 call_vbx_method (server
,
1199 "exception is thrown in a call "
1200 "when server returns `valuebox {bounded_string}`.\n");
1204 ::Test::val_bds_str_var arg1
;
1205 ::Test::val_bds_str_var arg2
;
1206 ::Test::val_bds_str_out arg2_out
= arg2
;
1207 ::Test::val_bds_str_var arg3
;
1209 call_vbx_method_s (server
,
1214 "exception is thrown in a call "
1215 "when server returns `valuebox {string<BOUND>}`.\n");
1221 int test_valuetypes (::Test::A_ptr server
, ::Test::vtp_init
*vtp_factory
)
1226 ::Test::vtp_var arg1
=
1227 ::Test::vtp::_downcast (vtp_factory
->create_for_unmarshal ());
1228 arg1
->b (CORBA::string_dup (::Test::FailStr
));
1229 arg1
->c (CORBA::string_dup (::Test::FailStr
));
1230 ::Test::vtp_var arg2
;
1231 ::Test::vtp_out arg2_out
= arg2
;
1232 ::Test::vtp_var arg3
=
1233 ::Test::vtp::_downcast (vtp_factory
->create_for_unmarshal ());
1235 call_vtp_method (server
,
1240 "exception is thrown in a call "
1241 "for `in valuetype {}`.\n");
1245 ::Test::vtp_var arg1
;
1246 ::Test::vtp_var arg2
;
1247 ::Test::vtp_out arg2_out
= arg2
;
1248 ::Test::vtp_var arg3
;
1250 call_vtp_method (server
,
1255 "exception is thrown in a call "
1256 "for `out valuetype {}`.\n");
1260 ::Test::vtp_var arg1
;
1261 ::Test::vtp_var arg2
;
1262 ::Test::vtp_out arg2_out
= arg2
;
1263 ::Test::vtp_var arg3
;
1265 call_vtp_method (server
,
1270 "exception is thrown in a call "
1271 "for `inout valuetype {}` (server side).\n");
1275 ::Test::vtp_var arg1
;
1276 ::Test::vtp_var arg2
;
1277 ::Test::vtp_out arg2_out
= arg2
;
1278 ::Test::vtp_var arg3
=
1279 ::Test::vtp::_downcast (vtp_factory
->create_for_unmarshal ());
1280 arg3
->b (CORBA::string_dup (::Test::FailStr
));
1281 arg3
->c (CORBA::string_dup (::Test::FailStr
));
1283 call_vtp_method (server
,
1288 "exception is thrown in a call "
1289 "for `inout valuetype {}`.\n");
1293 ::Test::vtp_var arg1
;
1294 ::Test::vtp_var arg2
;
1295 ::Test::vtp_out arg2_out
= arg2
;
1296 ::Test::vtp_var arg3
;
1298 call_vtp_method (server
,
1303 "exception is thrown in a call "
1304 "when server returns `valuetype {}`.\n");
1310 int test_exceptions (::Test::A_ptr server
)
1314 ::Test::string_field all
[] = {
1319 for (unsigned int i
= 0;
1320 i
< sizeof (all
) / sizeof (::Test::string_field
);
1325 server
->exc_method (all
[i
]);
1327 catch (const ::Test::exc
&)
1330 ACE_ERROR ((LM_ERROR
,
1331 "ERROR: Illegal exception is thrown.\n"));
1333 catch (const CORBA::BAD_PARAM
&)
1337 catch (const CORBA::Exception
&)
1340 ACE_ERROR ((LM_ERROR
,
1341 "ERROR: Wrong exception is thrown.\n"));
1349 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
1355 CORBA::ORB_var orb
=
1356 CORBA::ORB_init (argc
, argv
);
1358 ::Test::vtp_init
*vtp_factory
= 0;
1359 ACE_NEW_THROW_EX (vtp_factory
,
1361 CORBA::NO_MEMORY ());
1362 CORBA::ValueFactoryBase_var vtp_factory_owner
= vtp_factory
;
1364 orb
->register_value_factory (vtp_factory
->tao_repository_id (),
1367 if (parse_args (argc
, argv
) != 0)
1370 CORBA::Object_var object
=
1371 orb
->string_to_object (ior
);
1373 Test::A_var server
=
1374 Test::A::_narrow (object
.in ());
1376 if (CORBA::is_nil (server
.in ()))
1378 ACE_ERROR_RETURN ((LM_ERROR
,
1379 ACE_TEXT ("Object reference <%s> is nil\n"),
1384 status
|= test_strings (server
.in ());
1386 status
|= test_sequences (server
.in ());
1388 status
|= test_arrays (server
.in ());
1390 status
|= test_structs (server
.in ());
1392 status
|= test_unions (server
.in ());
1394 status
|= test_valueboxes (server
.in ());
1396 status
|= test_valuetypes (server
.in (), vtp_factory
);
1398 status
|= test_exceptions (server
.in ());
1400 server
->shutdown ();
1404 catch (const CORBA::Exception
& ex
)
1406 ex
._tao_print_exception ("Caught exception in client:");