Search in sources :

Example 1 with RestrictedByItem

use of org.apache.directory.api.ldap.aci.protectedItem.RestrictedByItem 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);
}
Also used : AttributeType(org.apache.directory.api.ldap.model.schema.AttributeType) RestrictedByItem(org.apache.directory.api.ldap.aci.protectedItem.RestrictedByItem) RestrictedByElem(org.apache.directory.api.ldap.aci.protectedItem.RestrictedByElem) Before(org.junit.Before)

Example 2 with RestrictedByItem

use of org.apache.directory.api.ldap.aci.protectedItem.RestrictedByItem in project directory-ldap-api by apache.

the class ProtectedItem_RestrictedByTest method initNames.

/**
 * Initialize name instances
 */
@Before
public void initNames() throws Exception {
    RestrictedByElem rbiA = new RestrictedByElem(new AttributeType("aa"), new AttributeType("aa"));
    RestrictedByElem rbiB = new RestrictedByElem(new AttributeType("bb"), new AttributeType("bb"));
    RestrictedByElem rbiC = new RestrictedByElem(new AttributeType("cc"), new AttributeType("cc"));
    RestrictedByElem rbiD = new RestrictedByElem(new AttributeType("dd"), new AttributeType("dd"));
    Set<RestrictedByElem> colA = new HashSet<RestrictedByElem>();
    colA.add(rbiA);
    colA.add(rbiB);
    colA.add(rbiC);
    Set<RestrictedByElem> colB = new HashSet<RestrictedByElem>();
    colB.add(rbiA);
    colB.add(rbiB);
    colB.add(rbiC);
    Set<RestrictedByElem> colC = new HashSet<RestrictedByElem>();
    colC.add(rbiB);
    colC.add(rbiC);
    colC.add(rbiD);
    restrictedByA = new RestrictedByItem(colA);
    restrictedByACopy = new RestrictedByItem(colA);
    restrictedByB = new RestrictedByItem(colB);
    restrictedByC = new RestrictedByItem(colC);
}
Also used : AttributeType(org.apache.directory.api.ldap.model.schema.AttributeType) RestrictedByItem(org.apache.directory.api.ldap.aci.protectedItem.RestrictedByItem) RestrictedByElem(org.apache.directory.api.ldap.aci.protectedItem.RestrictedByElem) HashSet(java.util.HashSet) Before(org.junit.Before)

Aggregations

RestrictedByElem (org.apache.directory.api.ldap.aci.protectedItem.RestrictedByElem)2 RestrictedByItem (org.apache.directory.api.ldap.aci.protectedItem.RestrictedByItem)2 AttributeType (org.apache.directory.api.ldap.model.schema.AttributeType)2 Before (org.junit.Before)2 HashSet (java.util.HashSet)1