use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class ApiLdapSchemaDataOsgiTest method useBundleClasses.
@Override
protected void useBundleClasses() throws LdapException, IOException {
JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
loader.getAllEnabled();
loader.getAllSchemas();
SchemaManager schemaManager = new DefaultSchemaManager();
schemaManager.getEnabled();
schemaManager.getDisabled();
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class ACIItemCheckerTest method init.
/**
* Initialization
*/
@BeforeClass
public static void init() throws Exception {
JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
SchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadAllEnabled();
checker = new ACIItemChecker(schemaManager);
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerAddTest method loadSystem.
private SchemaManager loadSystem() throws Exception {
LdifSchemaLoader loader = new LdifSchemaLoader(schemaRepository);
SchemaManager schemaManager = new DefaultSchemaManager(loader);
String schemaName = "system";
schemaManager.loadWithDeps(schemaName);
return schemaManager;
}
use of org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager in project directory-ldap-api by apache.
the class SchemaManagerLoadTest 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);
assertTrue(schemaManager.load("system"));
assertTrue(schemaManager.load("core"));
assertTrue(schemaManager.load("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 SchemaManagerLoadTest method testLoadDisabled.
@Test
public void testLoadDisabled() throws Exception {
SchemaManager schemaManager = new DefaultSchemaManager();
assertTrue(schemaManager.loadDisabled("nis"));
assertTrue(schemaManager.getErrors().isEmpty());
AttributeType at = schemaManager.getAttributeType("uidNumber");
// if nis schema was loaded then the at will not be null
assertNotNull(at);
}
Aggregations