2 #include "ace/Get_Opt.h"
3 #include "ace/SString.h"
5 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
7 bool expect_error
= false;
10 parse_args (int argc
, ACE_TCHAR
*argv
[])
12 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:x"));
15 while ((c
= get_opts ()) != -1)
19 ior
= get_opts
.opt_arg ();
28 ACE_ERROR_RETURN ((LM_ERROR
,
35 // Indicates successful parsing of the command line
40 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
45 CORBA::ORB_init (argc
, argv
);
47 if (parse_args (argc
, argv
) != 0)
50 CORBA::Object_var tmp
=
51 orb
->string_to_object(ior
);
53 Test::Hello_var hello
=
54 Test::Hello::_narrow(tmp
.in ());
56 if (CORBA::is_nil (hello
.in ()))
58 ACE_ERROR_RETURN ((LM_DEBUG
,
59 "Nil Test::Hello reference <%s>\n",
64 CORBA::String_var the_string
=
67 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - string returned <%C>\n",
74 catch (const CORBA::Exception
& ex
)
78 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) client - expected exception occurred!\n%s\n",
85 ex
._tao_print_exception ("Exception caught:");
92 ACE_DEBUG ((LM_ERROR
, "(%P|%t) client - expected error did not occur!\n"));