1 #include "Client_Task.h"
2 #include "ace/Get_Opt.h"
4 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:i:n:"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
22 iterations
= ACE_OS::atoi (get_opts
.opt_arg ());
26 threads
= ACE_OS::atoi (get_opts
.opt_arg ());
31 ACE_ERROR_RETURN ((LM_ERROR
,
40 // Indicates successful parsing of the command line
45 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
50 CORBA::ORB_init (argc
, argv
);
52 if (parse_args (argc
, argv
) != 0)
55 CORBA::Object_var tmp
=
56 orb
->string_to_object (ior
);
58 Test::Process_Factory_var process_factory
=
59 Test::Process_Factory::_narrow(tmp
.in ());
61 if (CORBA::is_nil (process_factory
.in ()))
63 ACE_ERROR_RETURN ((LM_DEBUG
,
64 "Nil process reference <%s>\n",
69 Client_Task
client_task (process_factory
.in (),
72 if (client_task
.activate (THR_NEW_LWP
| THR_JOINABLE
,
75 ACE_ERROR ((LM_ERROR
, "Error activating client task\n"));
77 ACE_Thread_Manager::instance ()->wait ();
79 process_factory
->shutdown ();
83 // Only pass the test if 90% of the calls worked
84 if (client_task
.successful_calls () < 0.9 * iterations
* threads
)
87 "ERROR: no calls were successful\n"));
90 catch (const CORBA::Exception
& ex
)
92 ex
._tao_print_exception ("Exception caught:");