use of org.apache.directory.api.ldap.model.schema.registries.DefaultSchema in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadWithDepsCoreInetOrgPersonAndNis.
/**
* test loading the "InetOrgPerson", "core" and a disabled schema
*/
@Test
public void testLoadWithDepsCoreInetOrgPersonAndNis() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
Schema system = loader.getSchema("system");
Schema core = loader.getSchema("core");
Schema empty = new DefaultSchema(loader, "empty");
Schema cosine = loader.getSchema("cosine");
Schema inetOrgPerson = loader.getSchema("InetOrgPerson");
assertTrue(schemaManager.load(system, core, empty, cosine, inetOrgPerson));
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(142, schemaManager.getAttributeTypeRegistry().size());
assertEquals(36, schemaManager.getComparatorRegistry().size());
assertEquals(42, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(50, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(66, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(300, schemaManager.getGlobalOidRegistry().size());
assertEquals(5, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("cosine"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("InetOrgPerson"));
}
Aggregations