2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
7 parse_args (int argc
, ACE_TCHAR
*argv
[])
9 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
12 while ((c
= get_opts ()) != -1)
16 ior
= get_opts
.opt_arg ();
21 ACE_ERROR_RETURN ((LM_ERROR
,
28 // Indicates successful parsing of the command line
33 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
37 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
39 if (parse_args (argc
, argv
) != 0)
42 CORBA::Object_var tmp
= orb
->string_to_object(ior
);
44 Test::Hello_var hello
= Test::Hello::_narrow(tmp
.in ());
46 if (CORBA::is_nil (hello
.in ()))
48 ACE_ERROR_RETURN ((LM_DEBUG
,
49 "Nil Test::Hello reference <%s>\n",
54 CORBA::ULong encountered_failures
= 0;
55 for (CORBA::ULong i
= 0; i
< Test::expected_failure_number
; ++i
)
59 CORBA::String_var the_string
= hello
->get_string ();
61 catch (::CORBA::Exception
const &)
63 CORBA::ULong
const modulo
= Test::expected_failure_number
/ 10;
64 if (++encountered_failures
% modulo
== 0)
68 "Expected exception\n"));
74 if (encountered_failures
== 0)
76 "ERROR: No expected exceptions occurred.\n"));
78 // By this time the server should accept the connection and
79 // must handle shutdown gracefully.
84 catch (const CORBA::Exception
& ex
)
86 ex
._tao_print_exception ("Exception caught:");