1 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:i:"));
13 while ((c
= get_opts ()) != -1)
17 ior
= get_opts
.opt_arg ();
21 niterations
= ACE_OS::atoi (get_opts
.opt_arg ());
26 ACE_ERROR_RETURN ((LM_ERROR
,
34 // Indicates successful parsing of the command line
39 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
44 CORBA::ORB_init (argc
, argv
);
46 if (parse_args (argc
, argv
) != 0)
49 CORBA::Object_var object
=
50 orb
->string_to_object (ior
);
52 Simple_Server_var server
=
53 Simple_Server::_narrow (object
.in ());
55 if (CORBA::is_nil (server
.in ()))
57 ACE_ERROR_RETURN ((LM_ERROR
,
58 "Object reference <%s> is nil.\n",
63 for (int i
= 0; i
!= niterations
; ++i
)
65 if (server
->test_method (i
) != i
)
68 "Unexpected result from test_method\n"));
73 server
->test_raise (i
);
75 "The test_raise call didn't raise\n"));
77 catch (Simple_Server::Failure
&fail
)
79 ACE_UNUSED_ARG (fail
);
80 // Do nothing, this is the normal behavior...
86 catch (const CORBA::SystemException
&ex
)
88 ex
._tao_print_exception ("Caught exception:");