use of org.apache.directory.api.ldap.model.schema.AttributeType in project directory-ldap-api by apache.
the class ProtectedItem_AttributeTypeTest method initNames.
/**
* Initialize name instances
*/
@Before
public void initNames() throws Exception {
Set<AttributeType> colA = new HashSet<AttributeType>();
colA.add(new AttributeType("aa"));
colA.add(new AttributeType("bb"));
colA.add(new AttributeType("cc"));
Set<AttributeType> colB = new HashSet<AttributeType>();
colB.add(new AttributeType("aa"));
colB.add(new AttributeType("bb"));
colB.add(new AttributeType("cc"));
Set<AttributeType> colC = new HashSet<AttributeType>();
colC.add(new AttributeType("bb"));
colC.add(new AttributeType("cc"));
colC.add(new AttributeType("dd"));
attributeTypeA = new AttributeTypeItem(colA);
attributeTypeACopy = new AttributeTypeItem(colA);
attributeTypeB = new AttributeTypeItem(colB);
attributeTypeC = new AttributeTypeItem(colC);
}
use of org.apache.directory.api.ldap.model.schema.AttributeType in project directory-ldap-api by apache.
the class ProtectedItem_SelfValueTest method initNames.
/**
* Initialize name instances
*/
@Before
public void initNames() throws Exception {
Set<AttributeType> colA = new HashSet<AttributeType>();
colA.add(new AttributeType("aa"));
colA.add(new AttributeType("bb"));
colA.add(new AttributeType("cc"));
Set<AttributeType> colB = new HashSet<AttributeType>();
colB.add(new AttributeType("aa"));
colB.add(new AttributeType("bb"));
colB.add(new AttributeType("cc"));
Set<AttributeType> colC = new HashSet<AttributeType>();
colC.add(new AttributeType("bb"));
colC.add(new AttributeType("cc"));
colC.add(new AttributeType("dd"));
selfValueA = new SelfValueItem(colA);
selfValueACopy = new SelfValueItem(colA);
selfValueB = new SelfValueItem(colB);
selfValueC = new SelfValueItem(colC);
}
use of org.apache.directory.api.ldap.model.schema.AttributeType in project directory-ldap-api by apache.
the class MaxValueCountItemTest method initNames.
/**
* Initialize maxValueCountItem instances
*/
@Before
public void initNames() throws Exception {
itemsA = new HashSet<MaxValueCountElem>();
itemsA.add(new MaxValueCountElem(new AttributeType("aa"), 1));
itemsA.add(new MaxValueCountElem(new AttributeType("aa"), 2));
itemsA.add(new MaxValueCountElem(new AttributeType("aa"), 3));
// Sets aren't ordered, so adding order must not matter
itemsB = new HashSet<MaxValueCountElem>();
itemsB.add(new MaxValueCountElem(new AttributeType("aa"), 2));
itemsB.add(new MaxValueCountElem(new AttributeType("aa"), 3));
itemsB.add(new MaxValueCountElem(new AttributeType("aa"), 1));
itemsC = new HashSet<MaxValueCountElem>();
itemsC.add(new MaxValueCountElem(new AttributeType("aa"), 1));
itemsC.add(new MaxValueCountElem(new AttributeType("bb"), 2));
itemsC.add(new MaxValueCountElem(new AttributeType("aa"), 3));
itemsD = new HashSet<MaxValueCountElem>();
itemsD.add(new MaxValueCountElem(new AttributeType("aa"), 1));
itemsD.add(new MaxValueCountElem(new AttributeType("aa"), 2));
itemsD.add(new MaxValueCountElem(new AttributeType("aa"), 4));
maxValueCountItemA = new MaxValueCountItem(itemsA);
maxValueCountItemACopy = new MaxValueCountItem(itemsA);
maxValueCountItemB = new MaxValueCountItem(itemsB);
maxValueCountItemC = new MaxValueCountItem(itemsC);
maxValueCountItemD = new MaxValueCountItem(itemsD);
}
use of org.apache.directory.api.ldap.model.schema.AttributeType in project directory-ldap-api by apache.
the class RestrictedByItemTest method initNames.
/**
* Initialize maxValueCountItem instances
*/
@Before
public void initNames() throws Exception {
elemsA = new HashSet<RestrictedByElem>();
elemsA.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("aa")));
elemsA.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("bb")));
elemsA.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("cc")));
// Sets aren't ordered, so adding order must not matter
elemsB = new HashSet<RestrictedByElem>();
elemsB.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("bb")));
elemsB.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("cc")));
elemsB.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("aa")));
elemsC = new HashSet<RestrictedByElem>();
elemsC.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("aa")));
elemsC.add(new RestrictedByElem(new AttributeType("bb"), new AttributeType("bb")));
elemsC.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("cc")));
elemsD = new HashSet<RestrictedByElem>();
elemsD.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("aa")));
elemsD.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("bb")));
elemsD.add(new RestrictedByElem(new AttributeType("aa"), new AttributeType("dd")));
restrictedByItemA = new RestrictedByItem(elemsA);
restrictedByItemACopy = new RestrictedByItem(elemsA);
restrictedByItemB = new RestrictedByItem(elemsB);
restrictedByItemC = new RestrictedByItem(elemsC);
restrictedByItemD = new RestrictedByItem(elemsD);
}
use of org.apache.directory.api.ldap.model.schema.AttributeType in project directory-ldap-api by apache.
the class SchemaManagerLoadTest 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);
assertTrue(schemaManager.load("system"));
assertTrue(schemaManager.load("core"));
assertTrue(schemaManager.load("cosine"));
assertFalse(schemaManager.load("nis"));
AttributeType at = schemaManager.getAttributeType("uidNumber");
// if nis schema was loaded then the at will not be null
assertNull(at);
assertTrue(schemaManager.getErrors().isEmpty());
assertEquals(133, schemaManager.getAttributeTypeRegistry().size());
assertEquals(36, schemaManager.getComparatorRegistry().size());
assertEquals(42, schemaManager.getMatchingRuleRegistry().size());
assertEquals(35, schemaManager.getNormalizerRegistry().size());
assertEquals(49, schemaManager.getObjectClassRegistry().size());
assertEquals(59, schemaManager.getSyntaxCheckerRegistry().size());
assertEquals(66, schemaManager.getLdapSyntaxRegistry().size());
assertEquals(290, schemaManager.getGlobalOidRegistry().size());
assertEquals(3, schemaManager.getRegistries().getLoadedSchemas().size());
assertNotNull(schemaManager.getRegistries().getLoadedSchema("system"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("core"));
assertNotNull(schemaManager.getRegistries().getLoadedSchema("cosine"));
assertNull(schemaManager.getRegistries().getLoadedSchema("nis"));
}
Aggregations