Package org.apache.ldap.common.subtree

Examples of org.apache.ldap.common.subtree.SubtreeSpecificationModifier


    }


    public void testDefaults() throws Exception
    {
        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        SubtreeSpecification ss = modifier.getSubtreeSpecification();
        Name apDn = new LdapName( "ou=system" );
        Name entryDn = new LdapName( "ou=users,ou=system" );
        Attribute objectClasses = new BasicAttribute( "objectClass" );

        assertTrue( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
View Full Code Here


    }


    public void testWithBase() throws Exception
    {
        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        modifier.setBase( new LdapName( "ou=users" ) );
        SubtreeSpecification ss = modifier.getSubtreeSpecification();
        Name apDn = new LdapName( "ou=system" );
        Name entryDn = new LdapName( "ou=users,ou=system" );
        Attribute objectClasses = new BasicAttribute( "objectClass" );

        assertTrue( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
View Full Code Here

    }


    public void testWithMinMax() throws Exception
    {
        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        modifier.setMinBaseDistance( 1 );
        modifier.setMaxBaseDistance( 3 );
        modifier.setBase( new LdapName( "ou=users" ) );
        SubtreeSpecification ss = modifier.getSubtreeSpecification();
        Name apDn = new LdapName( "ou=system" );
        Name entryDn = new LdapName( "ou=users,ou=system" );
        Attribute objectClasses = new BasicAttribute( "objectClass" );

        assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
View Full Code Here

    }


    public void testWithMinMaxAndChopAfter() throws Exception
    {
        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        Set chopAfter = new HashSet();
        chopAfter.add( new LdapName( "uid=Tori Amos" ) );
        chopAfter.add( new LdapName( "ou=twolevels,uid=akarasulu" ) );
        modifier.setChopAfterExclusions( chopAfter );
        modifier.setMinBaseDistance( 1 );
        modifier.setMaxBaseDistance( 3 );
        modifier.setBase( new LdapName( "ou=users" ) );
        SubtreeSpecification ss = modifier.getSubtreeSpecification();
        Name apDn = new LdapName( "ou=system" );
        Name entryDn = new LdapName( "ou=users,ou=system" );
        Attribute objectClasses = new BasicAttribute( "objectClass" );

        assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
View Full Code Here

    }


    public void testWithMinMaxAndChopBefore() throws Exception
    {
        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        Set chopBefore = new HashSet();
        chopBefore.add( new LdapName( "uid=Tori Amos" ) );
        chopBefore.add( new LdapName( "ou=threelevels,ou=twolevels,uid=akarasulu" ) );
        modifier.setChopBeforeExclusions( chopBefore );
        modifier.setMinBaseDistance( 1 );
        modifier.setMaxBaseDistance( 3 );
        modifier.setBase( new LdapName( "ou=users" ) );
        SubtreeSpecification ss = modifier.getSubtreeSpecification();
        Name apDn = new LdapName( "ou=system" );
        Name entryDn = new LdapName( "ou=users,ou=system" );
        Attribute objectClasses = new BasicAttribute( "objectClass" );

        assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
View Full Code Here

    public void testWithMinMaxAndSimpleRefinement() throws Exception
    {
        FilterParser parser = new FilterParserImpl();
        ExprNode refinement = parser.parse( "( objectClass = person )" );

        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        modifier.setRefinement( refinement );
        modifier.setMinBaseDistance( 1 );
        modifier.setMaxBaseDistance( 3 );
        modifier.setBase( new LdapName( "ou=users" ) );
        SubtreeSpecification ss = modifier.getSubtreeSpecification();
        Name apDn = new LdapName( "ou=system" );
        Name entryDn = new LdapName( "ou=users,ou=system" );
        Attribute objectClasses = new BasicAttribute( "objectClass", "person" );

        assertFalse( evaluator.evaluate( ss, apDn, entryDn, objectClasses ) );
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.subtree.SubtreeSpecificationModifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.