use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadSystem.
// -------------------------------------------------------------------------
// Test the load( String... schemaName) method
// -------------------------------------------------------------------------
/**
* test loading the "system" schema
*/
@Test
public void testLoadSystem() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("system");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(38, schemaManager.getAttributeTypeRegistry().size());
assertEquals(35, schemaManager.getComparatorRegistry().size());
assertEquals(35, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(9, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(59, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(141, schemaManager.getGlobalOidRegistry().size());
assertEquals(1, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadJava.
/**
* test loading the "java" schema, which depends on "system" and "core"
*/
@Test
public void testLoadJava() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("Java");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(99, schemaManager.getAttributeTypeRegistry().size());
assertEquals(36, schemaManager.getComparatorRegistry().size());
assertEquals(42, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(41, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(66, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(248, schemaManager.getGlobalOidRegistry().size());
assertEquals(3, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("Java"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadCollective.
/**
* test loading the "Collective" schema, which depends on "system" and "core"
*/
@Test
public void testLoadCollective() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("Collective");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(105, schemaManager.getAttributeTypeRegistry().size());
assertEquals(36, schemaManager.getComparatorRegistry().size());
assertEquals(42, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(36, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(66, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(249, schemaManager.getGlobalOidRegistry().size());
assertEquals(3, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("collective"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadCore.
/**
* test loading the "core" schema, which depends on "system"
*/
@Test
public void testLoadCore() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("core");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(92, schemaManager.getAttributeTypeRegistry().size());
assertEquals(36, schemaManager.getComparatorRegistry().size());
assertEquals(42, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(36, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(66, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(236, schemaManager.getGlobalOidRegistry().size());
assertEquals(2, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadWithDepsTest method testLoadOther.
/**
* test loading the "other" schema, which depends on "system", "core",
* "apache" and "apacheMeta"
*/
@Test
public void testLoadOther() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadWithDeps("other");
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(181, schemaManager.getAttributeTypeRegistry().size());
assertEquals(49, schemaManager.getComparatorRegistry().size());
assertEquals(55, schemaManager.getMatchingRuleRegistry().size());
assertEquals(48, schemaManager.getNormalizerRegistry().size());
assertEquals(66, schemaManager.getObjectClassRegistry().size());
assertEquals(66, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(78, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(380, schemaManager.getGlobalOidRegistry().size());
assertEquals(5, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("apache"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("apacheMeta"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("other"));
}
Aggregations