@LoadSchema(name = "nis", enabled = true),
@LoadSchema(name = "posix", enabled = false)
})
public void testCreateMethodDSWithPartition() throws Exception
{
DirectoryService service = DSAnnotationProcessor.getDirectoryService();
assertTrue( service.isStarted() );
assertEquals( "MethodDSWithPartition", service.getInstanceId() );
Set<String> expectedNames = new HashSet<String>();
expectedNames.add( "example" );
expectedNames.add( "schema" );
assertEquals( 2, service.getPartitions().size() );
for ( Partition partition : service.getPartitions() )
{
assertTrue( expectedNames.contains( partition.getId() ) );
if ( "example".equalsIgnoreCase( partition.getId() ) )
{
assertTrue( partition.isInitialized() );
assertEquals( "dc=example,dc=com", partition.getSuffixDn().getName() );
}
else if ( "schema".equalsIgnoreCase( partition.getId() ) )
{
assertTrue( partition.isInitialized() );
assertEquals( "ou=schema", partition.getSuffixDn().getName() );
}
}
assertTrue( service.getSchemaManager().isEnabled( "nis" ) );
service.shutdown();
FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
}