4 AppHelper::ref_to_file(CORBA::ORB_ptr orb
,
6 const ACE_TCHAR
* filename
)
8 CORBA::String_var ior
= orb
->object_to_string(obj
);
10 FILE* ior_file
= ACE_OS::fopen(filename
, ACE_TEXT("w"));
15 "(%P|%t) Cannot open output file [%s] to write IOR.\n",
17 throw TestAppException();
20 ACE_OS::fprintf(ior_file
, "%s", ior
.in());
21 ACE_OS::fclose(ior_file
);
25 PortableServer::POA_ptr
26 AppHelper::create_poa(const char* name
,
27 PortableServer::POA_ptr root_poa
,
28 PortableServer::POAManager_ptr mgr
,
29 CORBA::PolicyList
& policies
)
31 PortableServer::POA_var child_poa
= root_poa
->create_POA(name
,
35 if (CORBA::is_nil(child_poa
.in()))
38 "(%P|%t) Failed to create child POA: %s.\n", name
));
39 throw TestAppException();
42 return child_poa
._retn();
47 AppHelper::activate_servant(PortableServer::POA_ptr poa
,
48 PortableServer::Servant servant
)
50 // Activate the servant using the Child POA.
51 PortableServer::ObjectId_var oid
52 = poa
->activate_object(servant
);
55 = poa
->servant_to_reference(servant
);
57 if (CORBA::is_nil(obj
.in()))
60 "(%P|%t) Failed to convert servant_to_ref.\n"));
61 throw TestAppException();
69 AppHelper::validate_connection (CORBA::Object_ptr obj
)
71 for (CORBA::ULong j
= 0; j
!= 100; ++j
)
75 #if (TAO_HAS_CORBA_MESSAGING == 1)
76 CORBA::PolicyList_var unused
;
77 obj
->_validate_connection (unused
);
79 obj
->_is_a ("Not_An_IDL_Type");
80 #endif /* TAO_HAS_MESSAGING == 1 */
83 catch (const CORBA::Exception
&)