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"
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 char CLIENT
[] = "client"; // Copy const into non-const storage.
45 char *argv1
[] = { CLIENT
, 0 };
48 CORBA::ORB_init (one
, argv1
, "orb1");
51 char OPTION
[] = "-ORBFTSendFullGroupTC"; // Copy const into non-const storage.
52 char VALUE
[] = "1"; // Copy const into non-const storage.
53 char *argv2
[] = { CLIENT
, OPTION
, VALUE
, 0 };
59 CORBA::ORB_init (three
, argv2
, "orb2");
61 catch (const CORBA::BAD_PARAM
&)
63 ACE_DEBUG ((LM_ERROR
, "Error - REGRESSION - ORB doesn't even accept the config option\n"));
67 if (parse_args (argc
, argv
) != 0)
70 CORBA::Object_var tmp
=
71 orb1
->string_to_object (ior
);
73 Test::Hello_var hello
=
74 Test::Hello::_narrow(tmp
.in ());
76 if (CORBA::is_nil (hello
.in ()))
78 ACE_ERROR_RETURN ((LM_DEBUG
,
79 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
86 hello
->check_normal_context ();
88 catch (Test::MyException
&)
90 ACE_DEBUG ((LM_ERROR
, "Error - REGRESSION - normal format service context not transmitted\n"));
96 orb2
->string_to_object (ior
);
99 Test::Hello::_narrow(tmp
.in ());
101 if (CORBA::is_nil (hello
.in ()))
103 ACE_ERROR_RETURN ((LM_DEBUG
,
104 "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
111 hello
->check_extended_context ();
113 catch (const Test::MyException
&)
115 ACE_DEBUG ((LM_ERROR
, "Error - REGRESSION - extended format service context not transmitted\n"));
125 catch (const CORBA::Exception
& ex
)
127 ex
._tao_print_exception (
128 "Test failed (Not regression) because unexpected exception caught:");
134 ACE_DEBUG ((LM_ERROR
, "Error: REGRESSION identified!!!\n"));
138 ACE_DEBUG ((LM_DEBUG
, "Test passed !!!\n"));