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"
10 const ACE_TCHAR
*ior
= ACE_TEXT("file://ior.ior");
11 const ACE_TCHAR
*iogr
= ACE_TEXT("file://iogr.ior");
14 parse_args (int argc
, ACE_TCHAR
*argv
[])
16 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:l:"));
19 while ((c
= get_opts ()) != -1)
23 ior
= get_opts
.opt_arg ();
26 iogr
= get_opts
.opt_arg ();
30 ACE_ERROR_RETURN ((LM_ERROR
,
38 // Indicates successful parsing of the command line
43 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
45 CORBA::Boolean result
= 0;
49 CORBA::ORB_init (argc
, argv
);
51 if (parse_args (argc
, argv
) != 0)
54 // First perform the test with an IOR
55 CORBA::Object_var tmp
=
56 orb
->string_to_object(ior
);
58 Test::Hello_var hello
=
59 Test::Hello::_narrow(tmp
.in ());
61 if (CORBA::is_nil (hello
.in ()))
63 ACE_ERROR_RETURN ((LM_DEBUG
,
64 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
69 // Check this isn't generating exceptions for any other reason
72 if (hello
->has_ft_request_service_context ())
74 ACE_DEBUG ((LM_ERROR
, "ERROR - REGRESSION - Request made on a plain IOR has a FT_REQUEST service context.\n" ));
79 ACE_DEBUG ((LM_DEBUG
, "Request made on a plain IOR has no FT_REQUEST service context. This is OK.\n" ));
82 // Now repeat the test (for the converse result) with an IOGR
84 orb
->string_to_object(iogr
);
87 Test::Hello::_narrow(tmp
.in ());
89 if (CORBA::is_nil (hello
.in ()))
91 ACE_ERROR_RETURN ((LM_DEBUG
,
92 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
97 // Check this isn't generating transients for any other reason
100 if (! hello
->has_ft_request_service_context ())
102 ACE_DEBUG ((LM_ERROR
, "ERROR - REGRESSION - Request made on an IOGR has no FT_REQUEST service context.\n" ));
107 ACE_DEBUG ((LM_DEBUG
, "Request made on an IOGR has a FT_REQUEST service context. This is OK.\n" ));
114 catch (const CORBA::Exception
& ex
)
116 ex
._tao_print_exception (
117 "Test failed (Not regression) because unexpected exception caught:");
123 ACE_DEBUG ((LM_ERROR
, "Error: REGRESSION identified!!!\n"));
127 ACE_DEBUG ((LM_DEBUG
, "Test passed !!!\n"));