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
)
40 ACE_DEBUG ((LM_DEBUG
, "\"normal\" operation done\n"));
44 ACE_DEBUG ((LM_DEBUG
, "\"nothing\" operation done\n"));
50 catch (const Test_Interceptors::Silly
&)
52 ACE_DEBUG ((LM_DEBUG
, "Caught Silly\n"));
59 catch (const CORBA::INV_OBJREF
&)
61 ACE_DEBUG ((LM_DEBUG
, "Caught CORBA::INV_OBJREF\n"));
66 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
70 PortableInterceptor::ORBInitializer_ptr temp_initializer
;
72 ACE_NEW_RETURN (temp_initializer
,
73 Client_ORBInitializer
,
74 -1); // No exceptions yet!
75 PortableInterceptor::ORBInitializer_var initializer
=
78 PortableInterceptor::register_orb_initializer (initializer
.in ());
81 CORBA::ORB_init (argc
, argv
);
83 if (parse_args (argc
, argv
) != 0)
86 CORBA::Object_var object
=
87 orb
->string_to_object (ior
);
89 Test_Interceptors::Visual_var server
=
90 Test_Interceptors::Visual::_narrow (object
.in ());
92 if (CORBA::is_nil (server
.in ()))
94 ACE_ERROR_RETURN ((LM_ERROR
,
95 "Object reference <%s> is nil.\n",
100 run_test (server
.in ());
106 catch (const CORBA::Exception
& ex
)
108 ex
._tao_print_exception ("Caught exception in client:");