Package org.apache.directory.api.ldap.model.filter

Examples of org.apache.directory.api.ldap.model.filter.SubstringNode



    @Test
    public void testSubstringManyAnyNoFinal() throws ParseException
    {
        SubstringNode node = ( SubstringNode ) FilterParser.parse( null, "(ou=a*b*c*d*e*)" );
        // just check that it doesn't throw for now
        node = ( SubstringNode ) node.clone();
        assertEquals( "ou", node.getAttribute() );
        assertTrue( node instanceof SubstringNode );
        assertEquals( 4, node.getAny().size() );
        assertFalse( node.getAny().contains( "" ) );
        assertTrue( node.getAny().contains( "e" ) );
        assertTrue( node.getAny().contains( "b" ) );
        assertTrue( node.getAny().contains( "c" ) );
        assertTrue( node.getAny().contains( "d" ) );
        assertEquals( "a", node.getInitial() );
        assertEquals( null, node.getFinal() );
    }
View Full Code Here



    @Test
    public void testSubstringNoIniManyAnyNoFinal() throws ParseException
    {
        SubstringNode node = ( SubstringNode ) FilterParser.parse( null, "(ou=*b*c*d*e*)" );
        // just check that it doesn't throw for now
        node = ( SubstringNode ) node.clone();

        assertEquals( "ou", node.getAttribute() );
        assertTrue( node instanceof SubstringNode );
        assertEquals( 4, node.getAny().size() );
        assertFalse( node.getAny().contains( "" ) );
        assertTrue( node.getAny().contains( "e" ) );
        assertTrue( node.getAny().contains( "b" ) );
        assertTrue( node.getAny().contains( "c" ) );
        assertTrue( node.getAny().contains( "d" ) );
        assertEquals( null, node.getInitial() );
        assertEquals( null, node.getFinal() );
    }
View Full Code Here


    @Test
    public void testSubstringNoAnyDoubleSpaceStar() throws ParseException
    {
        SubstringNode node = ( SubstringNode ) FilterParser.parse( null, "(ou=foo* *bar)" );
        // just check that it doesn't throw for now
        node = ( SubstringNode ) node.clone();

        assertEquals( "ou", node.getAttribute() );
        assertTrue( node instanceof SubstringNode );
        assertEquals( 1, node.getAny().size() );
        assertFalse( node.getAny().contains( "" ) );
        assertTrue( node.getAny().contains( " " ) );
        assertEquals( "foo", node.getInitial() );
        assertEquals( "bar", node.getFinal() );
    }
View Full Code Here


    @Test
    public void testSubstringAnyDoubleSpaceStar() throws ParseException
    {
        SubstringNode node = ( SubstringNode ) FilterParser.parse( null, "(ou=foo* a *bar)" );
        // just check that it doesn't throw for now
        node = ( SubstringNode ) node.clone();

        assertEquals( "ou", node.getAttribute() );
        assertTrue( node instanceof SubstringNode );
        assertEquals( 1, node.getAny().size() );
        assertFalse( node.getAny().contains( "" ) );
        assertTrue( node.getAny().contains( " a " ) );
        assertEquals( "foo", node.getInitial() );
        assertEquals( "bar", node.getFinal() );
    }
View Full Code Here

     * href="http://nagoya.apache.org/jira/browse/DIRLDAP-21">DIRLDAP-21</a>.
     */
    @Test
    public void testSubstringStarAnyStar() throws ParseException
    {
        SubstringNode node = ( SubstringNode ) FilterParser.parse( null, "(ou=*foo*)" );
        // just check that it doesn't throw for now
        node = ( SubstringNode ) node.clone();

        assertEquals( "ou", node.getAttribute() );
        assertTrue( node instanceof SubstringNode );
        assertEquals( 1, node.getAny().size() );
        assertTrue( node.getAny().contains( "foo" ) );
        assertNull( node.getInitial() );
        assertNull( node.getFinal() );
    }
View Full Code Here

        ExprNode filter = searchRequest.getFilter();

        assertTrue( filter instanceof SubstringNode );

        SubstringNode substringFilter = ( SubstringNode ) filter;

        assertEquals( "sn", substringFilter.getAttribute() );
    }
View Full Code Here

        ExprNode filter = searchRequest.getFilter();

        assertTrue( filter instanceof SubstringNode );

        SubstringNode substringFilter = ( SubstringNode ) filter;

        assertEquals( "jack", substringFilter.getInitial().toString() );
    }
View Full Code Here

        ExprNode filter = searchRequest.getFilter();

        assertTrue( filter instanceof SubstringNode );

        SubstringNode substringFilter = ( SubstringNode ) filter;

        assertEquals( "DSMLv2.0 rocks!!", substringFilter.getInitial().toString() );
    }
View Full Code Here

        ExprNode filter = searchRequest.getFilter();

        assertTrue( filter instanceof SubstringNode );

        SubstringNode substringFilter = ( SubstringNode ) filter;

        assertNull( substringFilter.getInitial() );
    }
View Full Code Here

        ExprNode filter = searchRequest.getFilter();

        assertTrue( filter instanceof SubstringNode );

        SubstringNode substringFilter = ( SubstringNode ) filter;

        assertEquals( "jack", substringFilter.getInitial() );

        List<String> initials = substringFilter.getAny();

        assertEquals( 1, initials.size() );

        assertEquals( "kate", initials.get( 0 ).toString() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.filter.SubstringNode

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.