2 #include "ace/Get_Opt.h"
3 // Ensure that the PI library is linked in when building statically
5 #include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
9 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
12 parse_args (int argc
, ACE_TCHAR
*argv
[])
14 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
17 while ((c
= get_opts ()) != -1)
21 ior
= get_opts
.opt_arg ();
26 ACE_ERROR_RETURN ((LM_ERROR
,
33 // Indicates successful parsing of the command line
38 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
40 CORBA::Boolean result
= 0;
44 CORBA::ORB_init (argc
, argv
);
46 if (parse_args (argc
, argv
) != 0)
49 CORBA::Object_var tmp
=
50 orb
->string_to_object(ior
);
52 Test::Hello_var hello
=
53 Test::Hello::_narrow(tmp
.in ());
55 if (CORBA::is_nil (hello
.in ()))
57 ACE_ERROR_RETURN ((LM_DEBUG
,
58 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
63 // Check this isn't generating transients for any other reason
69 hello
->throw_location_forward ();
71 ACE_DEBUG ((LM_ERROR
, "REGRESSION - Test has failed !!!\n"));
74 catch (const CORBA::TRANSIENT
& my_ex
)
76 ACE_UNUSED_ARG (my_ex
);
77 ACE_DEBUG ((LM_DEBUG
, "Client catches a TRANSIENT, as expected. No problem !\n"));
84 catch (const CORBA::Exception
& ex
)
86 ex
._tao_print_exception (
87 "Test failed (Not regression) because unexpected exception caught:");
93 ACE_DEBUG ((LM_ERROR
, "Error: REGRESSION identified!!!\n"));
97 ACE_DEBUG ((LM_DEBUG
, "Test passed !!!\n"));