1 #include "ace/Get_Opt.h"
3 #include "Client_ORBInitializer.h"
4 #include "tao/ORBInitializer_Registry.h"
6 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("ef:"));
14 while ((c
= get_opts ()) != -1)
20 ior
= get_opts
.opt_arg ();
24 ACE_ERROR_RETURN ((LM_ERROR
,
35 run_test (Test_Interceptors::Visual_ptr server
)
39 ACE_DEBUG ((LM_DEBUG
, "\"normal\" operation done\n"));
43 ACE_DEBUG ((LM_DEBUG
, "\"nothing\" operation done\n"));
49 catch (const Test_Interceptors::Silly
&)
51 ACE_DEBUG ((LM_DEBUG
, "Caught Silly\n"));
58 catch (const CORBA::INV_OBJREF
&)
60 ACE_DEBUG ((LM_DEBUG
, "Caught CORBA::INV_OBJREF\n"));
65 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
69 PortableInterceptor::ORBInitializer_ptr temp_initializer
;
71 ACE_NEW_RETURN (temp_initializer
,
72 Client_ORBInitializer
,
73 -1); // No exceptions yet!
74 PortableInterceptor::ORBInitializer_var initializer
=
77 PortableInterceptor::register_orb_initializer (initializer
.in ());
80 CORBA::ORB_init (argc
, argv
);
82 if (parse_args (argc
, argv
) != 0)
85 CORBA::Object_var object
=
86 orb
->string_to_object (ior
);
88 Test_Interceptors::Visual_var server
=
89 Test_Interceptors::Visual::_narrow (object
.in ());
91 if (CORBA::is_nil (server
.in ()))
93 ACE_ERROR_RETURN ((LM_ERROR
,
94 "Object reference <%s> is nil.\n",
99 run_test (server
.in ());
105 catch (const CORBA::Exception
& ex
)
107 ex
._tao_print_exception ("Caught exception in client:");