3 const ACE_TCHAR
*ior_output_file
= ACE_TEXT("server.ior");
5 class Test_impl
: public virtual POA_Test
8 Test_impl (CORBA::ORB_ptr orb
);
9 virtual AnySeq
*RunTest(const AnySeq
¶ms
);
11 //FUZZ: disable check_for_lack_ACE_OS
12 virtual void shutdown ();
13 //FUZZ: enable check_for_lack_ACE_OS
18 Test_impl::Test_impl (CORBA::ORB_ptr orb
) : orb_ (CORBA::ORB::_duplicate (orb
))
25 this->orb_
->shutdown (false);
28 AnySeq
*Test_impl::RunTest(const AnySeq
¶ms
)
30 ACE_DEBUG ((LM_DEBUG
, "RunTest: params.length == %d\n", params
.length()));
31 for (CORBA::ULong count
= 0; count
< params
.length(); ++count
)
33 const Container
* container
= 0;
34 if (!(params
[count
] >>= container
))
36 ACE_ERROR ((LM_ERROR
, "ERROR, failed extract\n"));
40 const Inner
* inner
= 0;
41 if (!(container
->contents
>>= inner
))
43 ACE_ERROR ((LM_ERROR
, "ERROR, failed extract\n"));
46 ACE_DEBUG ((LM_DEBUG
, "%d %d %d %d %d\n", inner
->value1
, inner
->value2
, inner
->value3
, inner
->value4
, inner
->value5
));
50 AnySeq
*result
= new AnySeq(params
);
54 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
59 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
61 // Get reference to Root POA.
62 CORBA::Object_var obj
= orb
->resolve_initial_references ("RootPOA");
63 PortableServer::POA_var root_poa
= PortableServer::POA::_narrow (obj
.in ());
64 PortableServer::POAManager_var mgr
= root_poa
->the_POAManager ();
66 PortableServer::LifespanPolicy_var lifespan
=
67 root_poa
->create_lifespan_policy (PortableServer::PERSISTENT
);
68 CORBA::PolicyList policy_list
;
69 policy_list
.length (1);
70 policy_list
[0] = PortableServer::LifespanPolicy::_duplicate (
72 PortableServer::POA_var persistent_poa
=
73 root_poa
->create_POA ("PersistentPOA", mgr
.in (),
77 Test_impl
*test_servant
= 0;
78 ACE_NEW_RETURN (test_servant
,
79 Test_impl (orb
.in ()),
81 PortableServer::ServantBase_var
receiver_owner_transfer(test_servant
);
83 PortableServer::ObjectId_var id
=
84 persistent_poa
->activate_object (test_servant
);
87 persistent_poa
->id_to_reference (id
.in ());
89 CORBA::String_var ior
= orb
->object_to_string (obj
.in ());
91 // Output the IOR to the <ior_output_file>
92 FILE *output_file
= ACE_OS::fopen (ior_output_file
, "w");
94 ACE_ERROR_RETURN ((LM_ERROR
,
95 "Cannot open output file for writing IOR: %s\n",
98 ACE_OS::fprintf (output_file
, "%s", ior
.in ());
99 ACE_OS::fclose (output_file
);
101 // Activate POA manager
107 catch (const CORBA::Exception
&ex
)
109 ex
._tao_print_exception ("Exception caught: ");