2 #include "ace/OS_NS_stdio.h"
3 #include "ace/Get_Opt.h"
5 const ACE_TCHAR
*ior
= ACE_TEXT("file://server.ior");
6 const ACE_TCHAR
*uipmc_ior
= ACE_TEXT("corbaloc:miop:1.0@1.0-domain-1/127.0.0.1:23232");
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
23 ACE_ERROR_RETURN ((LM_ERROR
,
30 // Indicates successful parsing of the command line
35 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
40 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
42 if (parse_args (argc
, argv
) != 0)
45 CORBA::Object_var poa_object
=
46 orb
->resolve_initial_references("RootPOA");
48 PortableServer::POA_var root_poa
=
49 PortableServer::POA::_narrow (poa_object
.in ());
51 PortableServer::POAManager_var poa_manager
=
52 root_poa
->the_POAManager ();
53 poa_manager
->activate ();
55 CORBA::Object_var obj
=orb
->string_to_object (uipmc_ior
);
57 CORBA::Object_var tmp
= orb
->string_to_object (ior
);
58 server_var server
= server::_narrow (tmp
.in ());
62 server
->method (obj
.in());
64 ACE_DEBUG ((LM_DEBUG
, "Test passed !!\n"));
66 catch (const CORBA::SystemException
& marshal
)
68 ACE_DEBUG ((LM_ERROR
, "Test Failed - Regression. "
69 "Sending UIPMC object ref to server failed with:\n"));
70 marshal
._tao_print_exception ("Exception :\n");
76 catch(const CORBA::SystemException
& e
)
78 e
._tao_print_exception ("Unexpected exception - not a regression.\n");