use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadApache.
/**
* test loading the "apache" schema, which depends on "system" and "core"
*/
@Test
public void testLoadApache() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("apache");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(148, schemaManager.getAttributeTypeRegistry().size());
assertEquals(44, schemaManager.getComparatorRegistry().size());
assertEquals(50, schemaManager.getMatchingRuleRegistry().size());
assertEquals(43, schemaManager.getNormalizerRegistry().size());
assertEquals(53, schemaManager.getObjectClassRegistry().size());
assertEquals(62, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(73, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(324, schemaManager.getGlobalOidRegistry().size());
assertEquals(3, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("apache"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadApacheMeta.
/**
* test loading the "apacheMeta" schema, which depends on "system"
*/
@Test
public void testLoadApacheMeta() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("apacheMeta");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(71, schemaManager.getAttributeTypeRegistry().size());
assertEquals(40, schemaManager.getComparatorRegistry().size());
assertEquals(40, schemaManager.getMatchingRuleRegistry().size());
assertEquals(40, schemaManager.getNormalizerRegistry().size());
assertEquals(22, schemaManager.getObjectClassRegistry().size());
assertEquals(63, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(64, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(197, schemaManager.getGlobalOidRegistry().size());
assertEquals(2, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("apachemeta"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadNis.
/**
* test loading the "nis" schema, which depends on "system", "core" and "cosine",
* but is disabled
*/
@Test
public void testLoadNis() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("nis");
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"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadKrb5Kdc.
/**
* test loading the "Krb5Kdc" schema, which depends on "system" and "core"
*/
@Test
public void testLoadKrb5Kdc() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("Krb5Kdc");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(107, schemaManager.getAttributeTypeRegistry().size());
assertEquals(36, schemaManager.getComparatorRegistry().size());
assertEquals(42, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(39, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(66, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(254, schemaManager.getGlobalOidRegistry().size());
assertEquals(3, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("Krb5Kdc"));
}
Aggregations