Search in sources :

Example 11 with SubtreeSpecification

use of org.apache.directory.api.ldap.model.subtree.SubtreeSpecification in project directory-ldap-api by apache.

the class SubtreeSpecificationParserTest method testSpecWithEmptySpecificExclusions.

/**
 * Tests the parser with a valid specification with an empty specific
 * exclusions set.
 */
@Test
public void testSpecWithEmptySpecificExclusions() throws Exception {
    SubtreeSpecification ss = parser.parse(SPEC_WITH_EMPTY_SPECIFICEXCLUSIONS);
    assertNotNull(ss);
    assertTrue(ss.getChopBeforeExclusions().isEmpty());
}
Also used : SubtreeSpecification(org.apache.directory.api.ldap.model.subtree.SubtreeSpecification) Test(org.junit.Test)

Example 12 with SubtreeSpecification

use of org.apache.directory.api.ldap.model.subtree.SubtreeSpecification in project directory-ldap-api by apache.

the class SubtreeSpecificationParserTest method testWithBaseAndMinimumAndMaximum.

/**
 * Tests the parser with a valid specification with base and minimum and
 * maximum set.
 */
@Test
public void testWithBaseAndMinimumAndMaximum() throws Exception {
    SubtreeSpecification ss = parser.parse(SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM);
    assertEquals(new Dn("ou=ORGANIZATION UNIT").getName(), ss.getBase().getName());
    assertEquals(1, ss.getMinBaseDistance());
    assertEquals(2, ss.getMaxBaseDistance());
}
Also used : Dn(org.apache.directory.api.ldap.model.name.Dn) SubtreeSpecification(org.apache.directory.api.ldap.model.subtree.SubtreeSpecification) Test(org.junit.Test)

Example 13 with SubtreeSpecification

use of org.apache.directory.api.ldap.model.subtree.SubtreeSpecification in project directory-ldap-api by apache.

the class SubtreeSpecificationParserTest method testSpecOrderOfComponentsDoesNotMatter.

/**
 * Tests the parser with a valid specification with unordinary component
 * order.
 */
@Test
public void testSpecOrderOfComponentsDoesNotMatter() throws Exception {
    SubtreeSpecification ss = parser.parse(SPEC_ORDER_OF_COMPONENTS_DOES_NOT_MATTER);
    assertNotNull(ss);
}
Also used : SubtreeSpecification(org.apache.directory.api.ldap.model.subtree.SubtreeSpecification) Test(org.junit.Test)

Aggregations

SubtreeSpecification (org.apache.directory.api.ldap.model.subtree.SubtreeSpecification)13 Test (org.junit.Test)12 Dn (org.apache.directory.api.ldap.model.name.Dn)5 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Subtree (org.apache.directory.api.ldap.aci.UserClass.Subtree)1 AndRefinement (org.apache.directory.api.ldap.model.subtree.AndRefinement)1 BaseSubtreeSpecification (org.apache.directory.api.ldap.model.subtree.BaseSubtreeSpecification)1 ItemRefinement (org.apache.directory.api.ldap.model.subtree.ItemRefinement)1 NotRefinement (org.apache.directory.api.ldap.model.subtree.NotRefinement)1 OrRefinement (org.apache.directory.api.ldap.model.subtree.OrRefinement)1 Refinement (org.apache.directory.api.ldap.model.subtree.Refinement)1 Before (org.junit.Before)1