{
assertTrue( getLdapServer().isStarted() );
// Check the caches
DnNode<AccessControlAdministrativePoint> acCache = getLdapServer().getDirectoryService().getAccessControlAPCache();
AdministrativePoint aap1 = acCache.getElement( new Dn( schemaManager, "ou=AAP1,ou=noAP1,ou=system" ) );
assertNotNull( aap1 );
// Stop the server now, we will restart it immediately
getLdapServer().stop();
assertFalse( getLdapServer().isStarted() );
// And shutdown the DS too
getLdapServer().getDirectoryService().shutdown();
assertFalse( getLdapServer().getDirectoryService().isStarted() );
// And restart
getLdapServer().getDirectoryService().startup();
getLdapServer().start();
schemaManager = getLdapServer().getDirectoryService().getSchemaManager();
assertTrue( getService().isStarted() );
assertTrue( getLdapServer().getDirectoryService().isStarted() );
// Check that the roles are present
assertEquals( "autonomousArea", getAdminRole( "ou=AAP1,ou=noAP1,ou=system" ).getString() );
assertEquals( "autonomousArea", getAdminRole( "ou=AAP2,ou=system" ).getString() );
assertEquals( "autonomousArea", getAdminRole( "ou=subAAP1,ou=noAP3,ou=AAP2,ou=system" ).getString() );
// Check the caches
acCache = getLdapServer().getDirectoryService().getAccessControlAPCache();
DnNode<CollectiveAttributeAdministrativePoint> caCache = getLdapServer().getDirectoryService()
.getCollectiveAttributeAPCache();
DnNode<TriggerExecutionAdministrativePoint> teCache = getLdapServer().getDirectoryService()
.getTriggerExecutionAPCache();
DnNode<SubschemaAdministrativePoint> ssCache = getLdapServer().getDirectoryService().getSubschemaAPCache();
// The ACs
aap1 = acCache.getElement( new Dn( schemaManager, "ou=AAP1,ou=noAP1,ou=system" ) );
assertNotNull( aap1 );
AdministrativePoint aap2 = acCache.getElement( new Dn( schemaManager, "ou=AAP2,ou=system" ) );
assertNotNull( aap2 );
AdministrativePoint subAap1 = acCache.getElement( new Dn( schemaManager, "ou=subAAP1,ou=noAP3,ou=AAP2,ou=system" ) );
assertNotNull( subAap1 );
// The ACs
aap1 = caCache.getElement( new Dn( schemaManager, "ou=AAP1,ou=noAP1,ou=system" ) );
assertNotNull( aap1 );