1 #include "ace/OS_NS_string.h"
2 #include "ace/OS_NS_unistd.h"
3 #include "ace/Get_Opt.h"
5 #include "Smart_Proxy_Impl.h"
7 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
11 parse_args (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("i:"));
16 while ((c
= get_opts ()) != -1)
20 ior
= get_opts
.opt_arg ();
24 ACE_ERROR_RETURN ((LM_ERROR
,
34 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
38 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
40 if (parse_args (argc
, argv
) != 0)
43 CORBA::Object_var obj
= orb
->string_to_object (ior
);
45 // force a scope to see the destruction of the server object
47 Test_Smart_Factory
*test_factory
= 0;
48 ACE_NEW_RETURN (test_factory
,
52 ACE_UNUSED_ARG (test_factory
);
55 Test::_narrow(obj
.in());
57 if (CORBA::is_nil (server
.in())) {
58 ACE_ERROR_RETURN ((LM_ERROR
,
59 "Object reference <%s> is nil.\n",
66 #if (TAO_HAS_MINIMUM_CORBA == 0)
67 // Testing the _non_existent function
68 ACE_DEBUG ((LM_DEBUG
, "Testing _non_existent()\n"));
70 server
->_non_existent();
72 ACE_ERROR_RETURN ((LM_ERROR
,
73 "Not a Messenger object reference\n"),
76 ACE_DEBUG ((LM_DEBUG
,"Successfully called _non_existent()\n"));
77 #endif /* TAO_HAS_MINIMUM_CORBA */
81 // The following sleep is a hack to make sure the above oneway
82 // request gets sent before we exit. Otherwise, at least on
83 // Windows XP, the server may not even get the request.
84 ACE_Time_Value
tv (0, 100000);
87 // here we should get the smart proxy destructor printout
89 ACE_ERROR_RETURN((LM_ERROR
,
90 "The Smart proxy is not deleted\n"),1);
95 catch (const CORBA::Exception
& ex
)
97 ex
._tao_print_exception ("Client-side exception:");