{
return;
}
final String TEST_NAME = "SecurityMapConfigTest.testCreateRemove";
final ResourceAdapterConfig rac = ResourceAdapterConfigTest.createInstance(
getDomainConfig(), TEST_NAME );
try
{
final ConnectorConnectionPoolConfig ccpc =
ConnectorConnectionPoolConfigTest.createInstance( getDomainConfig(),
TEST_NAME,
CONNECTOR_DEF_NAME,
rac.getName(), null );
try
{
final String smcName = "SecurityMapConfigTest.testCreateRemove";
final String[] principals = new String[] { "SecurityMapConfigTest.testCreateRemove" };
final String[] userGroups = new String[ 0 ];
final SecurityMapConfig smc = createInstance(
ccpc,
smcName,
DEFAULT_BACKEND_PRINCIPAL,
DEFAULT_BACKEND_PASSWORD,
principals,
null );
try
{
assert( smcName.equals( smc.getName() ) );
assert( smc == ccpc.getSecurityMapConfigMap().get( smc.getName() ) );
testGetters( smc );
final Set<String> principalsBefore = GSetUtil.newSet( smc.getPrincipalNames() );
final String PRINCIPAL1 = "testCreateRemove.test1";
smc.createPrincipal( PRINCIPAL1 );
final Set<String> principalsAfter = GSetUtil.newSet( smc.getPrincipalNames() );
assert( principalsAfter.contains( PRINCIPAL1 ) );
smc.removePrincipal( PRINCIPAL1 );
assert( principalsBefore.equals( GSetUtil.newSet( smc.getPrincipalNames() ) ) );
}
finally
{
ccpc.removeSecurityMapConfig( smc.getName() );
}
}
finally
{
getDomainConfig().removeConnectorConnectionPoolConfig( ccpc.getName() );
}
}
finally
{
getDomainConfig().removeResourceAdapterConfig( rac.getName() );
}
}