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://ior.ior");
10 const ACE_TCHAR
*iogr
= ACE_TEXT("file://iogr.ior");
13 parse_args (int argc
, ACE_TCHAR
*argv
[])
15 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:l:"));
18 while ((c
= get_opts ()) != -1)
22 ior
= get_opts
.opt_arg ();
25 iogr
= get_opts
.opt_arg ();
29 ACE_ERROR_RETURN ((LM_ERROR
,
37 // Indicates successful parsing of the command line
42 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
44 CORBA::Boolean result
= 0;
48 CORBA::ORB_init (argc
, argv
);
50 if (parse_args (argc
, argv
) != 0)
53 // First perform the test with an IOR
54 CORBA::Object_var tmp
=
55 orb
->string_to_object(ior
);
57 Test::Hello_var hello
=
58 Test::Hello::_narrow(tmp
.in ());
60 if (CORBA::is_nil (hello
.in ()))
62 ACE_ERROR_RETURN ((LM_DEBUG
,
63 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
68 // Check this isn't generating exceptions for any other reason
71 if (hello
->has_ft_request_service_context ())
73 ACE_DEBUG ((LM_ERROR
, "ERROR - REGRESSION - Request made on a plain IOR has a FT_REQUEST service context.\n" ));
78 ACE_DEBUG ((LM_DEBUG
, "Request made on a plain IOR has no FT_REQUEST service context. This is OK.\n" ));
81 // Now repeat the test (for the converse result) with an IOGR
83 orb
->string_to_object(iogr
);
86 Test::Hello::_narrow(tmp
.in ());
88 if (CORBA::is_nil (hello
.in ()))
90 ACE_ERROR_RETURN ((LM_DEBUG
,
91 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
96 // Check this isn't generating transients for any other reason
99 if (! hello
->has_ft_request_service_context ())
101 ACE_DEBUG ((LM_ERROR
, "ERROR - REGRESSION - Request made on an IOGR has no FT_REQUEST service context.\n" ));
106 ACE_DEBUG ((LM_DEBUG
, "Request made on an IOGR has a FT_REQUEST service context. This is OK.\n" ));
113 catch (const CORBA::Exception
& ex
)
115 ex
._tao_print_exception (
116 "Test failed (Not regression) because unexpected exception caught:");
122 ACE_DEBUG ((LM_ERROR
, "Error: REGRESSION identified!!!\n"));
126 ACE_DEBUG ((LM_DEBUG
, "Test passed !!!\n"));