1 // Ensure that the PI library is linked in when building statically
4 #include "ace/Get_Opt.h"
5 #include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
10 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
13 parse_args (int argc
, ACE_TCHAR
*argv
[])
15 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
18 while ((c
= get_opts ()) != -1)
22 ior
= get_opts
.opt_arg ();
27 ACE_ERROR_RETURN ((LM_ERROR
,
34 // Indicates successful parsing of the command line
39 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
41 CORBA::Boolean result
= 0;
45 char CLIENT
[] = "client"; // Copy const into non-const storage.
46 char *argv1
[] = { CLIENT
, 0 };
49 CORBA::ORB_init (one
, argv1
, "orb1" );
52 char OPTION
[] = "-ORBFTSendFullGroupTC"; // Copy const into non-const storage.
53 char VALUE
[] = "1"; // Copy const into non-const storage.
54 char *argv2
[] = { CLIENT
, OPTION
, VALUE
, 0 };
60 CORBA::ORB_init (three
, argv2
, "orb2" );
62 catch (const CORBA::BAD_PARAM
&)
64 ACE_DEBUG ((LM_ERROR
, "Error - REGRESSION - ORB doesn't even accept the config option\n"));
68 if (parse_args (argc
, argv
) != 0)
71 CORBA::Object_var tmp
=
72 orb1
->string_to_object (ior
);
74 Test::Hello_var hello
=
75 Test::Hello::_narrow(tmp
.in () );
77 if (CORBA::is_nil (hello
.in ()))
79 ACE_ERROR_RETURN ((LM_DEBUG
,
80 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
87 hello
->check_normal_context ();
89 catch (Test::MyException
&)
91 ACE_DEBUG ((LM_ERROR
, "Error - REGRESSION - normal format service context not transmitted\n"));
97 orb2
->string_to_object (ior
);
100 Test::Hello::_narrow(tmp
.in () );
102 if (CORBA::is_nil (hello
.in ()))
104 ACE_ERROR_RETURN ((LM_DEBUG
,
105 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
112 hello
->check_extended_context ();
114 catch (const Test::MyException
&)
116 ACE_DEBUG ((LM_ERROR
, "Error - REGRESSION - extended format service context not transmitted\n"));
126 catch (const CORBA::Exception
& ex
)
128 ex
._tao_print_exception (
129 "Test failed (Not regression) because unexpected exception caught:");
135 ACE_DEBUG ((LM_ERROR
, "Error: REGRESSION identified!!!\n"));
139 ACE_DEBUG ((LM_DEBUG
, "Test passed !!!\n"));