1 #include "ace/SString.h"
2 #include "ace/Get_Opt.h"
3 #include "ace/OS_NS_unistd.h"
6 const ACE_TCHAR
*ior_input_file
= 0;
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("o:"));
14 while ((c
= get_opts ()) != -1)
18 ior_input_file
= get_opts
.opt_arg ();
22 ACE_ERROR_RETURN ((LM_ERROR
,
29 // Indicates successful parsing of the command line
34 run_test (Simple_Server_ptr server
);
37 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
43 CORBA::ORB_init (argc
, argv
);
45 if (parse_args (argc
, argv
) == -1)
48 CORBA::Object_var objref
=
49 orb
->string_to_object (ior_input_file
);
51 if (objref
.in () == 0)
53 //FUZZ: disable check_for_NULL
54 ACE_ERROR_RETURN ((LM_ERROR
,
55 "The received objref is NULL\n"),
57 //FUZZ: enable check_for_NULL
60 Simple_Server_var server
=
61 Simple_Server::_narrow (objref
.in ());
63 if (CORBA::is_nil (server
.in ()))
65 ACE_ERROR_RETURN ((LM_ERROR
,
66 "Object reference is nil\n"),
70 run_test (server
.in ());
72 catch (const CORBA::Exception
& ex
)
74 ex
._tao_print_exception ("Caught an exception\n");
80 void run_test (Simple_Server_ptr server
)
82 for (int loop
= 0; loop
< 10; loop
++)
87 "About to make remote call\n"));
91 server
->remote_call ();
93 /*ACE_DEBUG ((LM_DEBUG,
94 "Kill the primary . . . "));
96 ACE_DEBUG ((LM_DEBUG, " hope you did\n")); */
98 "I am going to shutdown\n"));
102 catch (const CORBA::UserException
& x
)
104 x
._tao_print_exception ("Caught an ");
106 catch (const CORBA::TRANSIENT
& t
)
108 t
._tao_print_exception ("Caught Exception");
110 catch (const CORBA::COMM_FAILURE
& f
)
112 f
._tao_print_exception ("A (sort of) expected COMM_FAILURE");
113 ACE_DEBUG ((LM_DEBUG
,
114 "Automagically re-issuing request on COMM_FAILURE\n"));
116 catch (const CORBA::Exception
& ex
)
118 ex
._tao_print_exception ("Unexpected exception");