1 #include "ace/Get_Opt.h"
4 #include "Echo_Client_ORBInitializer.h"
6 #include "tao/ORBInitializer_Registry.h"
8 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
11 parse_args (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("ef:"));
16 while ((c
= get_opts ()) != -1)
22 ior
= get_opts
.opt_arg ();
26 ACE_ERROR_RETURN ((LM_ERROR
,
37 run_test (Test_Interceptors::Visual_ptr server
)
39 CORBA::String_var msg
;
44 CORBA::Long one
= 1, two
= 1, result
= 0;
45 result
= server
->calculate (one
,
49 "calculate() result = %d\n",
52 Test_Interceptors::Visual::VarLenStruct_var v
=
53 server
->the_structure ();
56 "the_structure() result is:\n"
66 catch (const Test_Interceptors::Silly
&)
68 ACE_DEBUG ((LM_DEBUG
, "Caught Silly\n"));
75 catch (const CORBA::INV_OBJREF
&)
77 ACE_DEBUG ((LM_DEBUG
, "Caught CORBA::INV_OBJREF\n"));
82 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
86 #if TAO_HAS_INTERCEPTORS == 1
87 PortableInterceptor::ORBInitializer_ptr temp_initializer
=
88 PortableInterceptor::ORBInitializer::_nil ();
90 ACE_NEW_RETURN (temp_initializer
,
91 Echo_Client_ORBInitializer
,
92 -1); // No exceptions yet!
93 PortableInterceptor::ORBInitializer_var orb_initializer
=
96 PortableInterceptor::register_orb_initializer (orb_initializer
.in ());
97 #endif /* TAO_HAS_INTERCEPTORS == 1 */
100 CORBA::ORB_init (argc
, argv
);
102 if (parse_args (argc
, argv
) != 0)
105 CORBA::Object_var object
=
106 orb
->string_to_object (ior
);
108 Test_Interceptors::Visual_var server
=
109 Test_Interceptors::Visual::_narrow (object
.in ());
111 if (CORBA::is_nil (server
.in ()))
113 ACE_ERROR_RETURN ((LM_ERROR
,
114 "Object reference <%s> is nil.\n",
119 run_test (server
.in ());
125 catch (const CORBA::Exception
& ex
)
127 ex
._tao_print_exception ("Caught exception:");