{
void run(ORB orb, POA root)
{
org.omg.CORBA.Object obj;
Policy[] policies = new Policy[ 0 ];
POA poa;
POA parent;
POA poa2;
POA poa3;
POAManager mgr;
String str;
POAManager rootMgr = root.the_POAManager();
TEST(rootMgr != null);
//
// Create child POA
//
try
{
poa = root.create_POA("poa1", rootMgr, policies);
}
catch (InvalidPolicy ex)
{
fail(ex);
throw new RuntimeException(ex);
}
catch (AdapterAlreadyExists ex)
{
fail(ex);
throw new RuntimeException(ex);
}
//
// Test: find_POA
//
try
{
poa2 = root.find_POA("poa1", false);
}
catch (AdapterNonExistent ex)
{
fail(ex);
throw new RuntimeException(ex);
}
TEST(poa2 != null);
TEST(poa2._is_equivalent(poa));
//
// Test: AdapterNonExistent exception
//
try
{
poa2 = root.find_POA("poaX", false);
TEST(false); // find_POA should not have succeeded
}
catch (AdapterNonExistent ex)
{
// expected
}
//
// Create child POA
//
try
{
poa2 = root.create_POA("poa2", rootMgr, policies);
}
catch (InvalidPolicy ex)
{
fail(ex);
throw new RuntimeException(ex);
}
catch (AdapterAlreadyExists ex)
{
fail(ex);
throw new RuntimeException(ex);
}
//
// Test: Confirm parent knows about child
//
try
{
poa3 = root.find_POA("poa2", false);
}
catch (AdapterNonExistent ex)
{
fail(ex);
throw new RuntimeException(ex);
}
TEST(poa3 != null);
TEST(poa3._is_equivalent(poa2));
}