1 #include "ace/Get_Opt.h"
3 #include "Client_ORBInitializer.h"
5 #include "tao/ORBInitializer_Registry.h"
7 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
10 parse_args (int argc
, ACE_TCHAR
*argv
[])
12 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("ef:"));
15 while ((c
= get_opts ()) != -1)
21 ior
= get_opts
.opt_arg ();
25 ACE_ERROR_RETURN ((LM_ERROR
,
36 run_test (Test_Interceptors::Visual_ptr server
)
41 ACE_DEBUG ((LM_DEBUG
, "\"normal\" operation done\n"));
45 ACE_DEBUG ((LM_DEBUG
, "\"nothing\" operation done\n"));
51 catch (const Test_Interceptors::Silly
&)
53 ACE_DEBUG ((LM_DEBUG
, "Caught Silly\n"));
60 catch (const CORBA::INV_OBJREF
&)
62 ACE_DEBUG ((LM_DEBUG
, "Caught CORBA::INV_OBJREF\n"));
67 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
71 PortableInterceptor::ORBInitializer_ptr temp_initializer
;
73 ACE_NEW_RETURN (temp_initializer
,
74 Client_ORBInitializer
,
75 -1); // No exceptions yet!
76 PortableInterceptor::ORBInitializer_var initializer
=
79 PortableInterceptor::register_orb_initializer (initializer
.in ());
82 CORBA::ORB_init (argc
, argv
);
84 if (parse_args (argc
, argv
) != 0)
87 CORBA::Object_var object
=
88 orb
->string_to_object (ior
);
90 Test_Interceptors::Visual_var server
=
91 Test_Interceptors::Visual::_narrow (object
.in ());
93 if (CORBA::is_nil (server
.in ()))
95 ACE_ERROR_RETURN ((LM_ERROR
,
96 "Object reference <%s> is nil.\n",
101 run_test (server
.in ());
107 catch (const CORBA::Exception
& ex
)
109 ex
._tao_print_exception ("Caught exception in client:");