Search in sources :

Example 1 with MaxValueCountElem

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

Example 2 with MaxValueCountElem

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

the class ProtectedItem_MaxValueCountTest method initNames.

/**
 * Initialize name instances
 */
@Before
public void initNames() throws Exception {
    MaxValueCountElem mvciA = new MaxValueCountElem(new AttributeType("aa"), 1);
    MaxValueCountElem mvciB = new MaxValueCountElem(new AttributeType("bb"), 2);
    MaxValueCountElem mvciC = new MaxValueCountElem(new AttributeType("cc"), 3);
    MaxValueCountElem mvciD = new MaxValueCountElem(new AttributeType("dd"), 4);
    Set<MaxValueCountElem> colA = new HashSet<MaxValueCountElem>();
    colA.add(mvciA);
    colA.add(mvciB);
    colA.add(mvciC);
    Set<MaxValueCountElem> colB = new HashSet<MaxValueCountElem>();
    colB.add(mvciA);
    colB.add(mvciB);
    colB.add(mvciC);
    Set<MaxValueCountElem> colC = new HashSet<MaxValueCountElem>();
    colC.add(mvciB);
    colC.add(mvciC);
    colC.add(mvciD);
    maxValueCountA = new MaxValueCountItem(colA);
    maxValueCountACopy = new MaxValueCountItem(colA);
    maxValueCountB = new MaxValueCountItem(colB);
    maxValueCountC = new MaxValueCountItem(colC);
}
Also used : AttributeType(org.apache.directory.api.ldap.model.schema.AttributeType) MaxValueCountItem(org.apache.directory.api.ldap.aci.protectedItem.MaxValueCountItem) MaxValueCountElem(org.apache.directory.api.ldap.aci.protectedItem.MaxValueCountElem) HashSet(java.util.HashSet) Before(org.junit.Before)

Aggregations

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