3 #include "ace/Get_Opt.h"
5 void parse_args(int argc
, ACE_TCHAR
* argv
[]);
6 void test_remote_calls(CORBA::ORB_ptr orb
);
7 void test_colocated_calls(CORBA::ORB_ptr orb
);
10 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
14 ACE_DEBUG ((LM_DEBUG
, "Starting client\n"));
15 CORBA::ORB_var orb
= initialize_orb_and_poa(argc
, argv
);
17 parse_args(argc
, argv
);
19 ACE_DEBUG ((LM_DEBUG
, "Testing remote\n"));
20 test_remote_calls(orb
.in());
22 ACE_DEBUG ((LM_DEBUG
, "Testing colocated\n"));
23 test_colocated_calls(orb
.in());
25 ACE_DEBUG ((LM_DEBUG
, "Testing ready\n"));
36 const ACE_TCHAR
*ior_argument
= ACE_TEXT("file://test.ior");
37 int niterations
= 100;
40 parse_args (int argc
, ACE_TCHAR
*argv
[])
42 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:i:"));
45 while ((c
= get_opts ()) != -1)
50 ior_argument
= get_opts
.opt_arg ();
54 niterations
= ACE_OS::atoi (get_opts
.opt_arg ());
59 throw "Usage: [-k ior] [-i iteration_count]";
66 ACE_TCHAR
const * ior
,
69 CORBA::Object_var object
= orb
->string_to_object(ior
);
70 Test_var test
= Test::_narrow(object
.in());
72 if(CORBA::is_nil(test
.in()))
74 throw "Nil reference after narrow";
77 for(int i
= 0; i
!= niterations
; ++i
)
79 test
->sendc_the_operation(AMI_TestHandler::_nil());
82 ACE_Time_Value
wait_for_responses_interval(1, 0);
83 orb
->run(wait_for_responses_interval
);
89 void test_remote_calls(CORBA::ORB_ptr orb
)
91 test_impl(orb
, ior_argument
, true);
94 void test_colocated_calls(CORBA::ORB_ptr orb
)
97 CORBA::String_var ior
=
98 servant
.create_and_activate_server();
100 test_impl(orb
, ACE_TEXT_CHAR_TO_TCHAR(ior
.in()), false);