*/
@Test
public void testLoadCoreInetOrgPersonAndBad() throws Exception
{
LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
SchemaManager schemaManager = new DefaultSchemaManager( loader );
try
{
schemaManager.loadWithDeps( "core", "bad", "InetOrgPerson" );
fail();
}
catch ( LdapUnwillingToPerformException lonse )
{
// expected
}
// No SchemaObject should be loaded as we had an error
assertTrue( schemaManager.getErrors().isEmpty() );
assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
assertEquals( 0, schemaManager.getComparatorRegistry().size() );
assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
assertEquals( 0, schemaManager.getGlobalOidRegistry().size() );
assertEquals( 0, schemaManager.getRegistries().getLoadedSchemas().size() );
assertNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
assertNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
assertNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
assertNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
}