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

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



    @Test(expected = InvalidCursorPositionException.class)
    public void testInvalidCursorPositionException() throws Exception
    {
        SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "b", null );
        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
        cursor.get();
    }
View Full Code Here



    @Test(expected = InvalidCursorPositionException.class)
    public void testInvalidCursorPositionException2() throws Exception
    {
        SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
        cursor.get();
    }
View Full Code Here


    @Test(expected = UnsupportedOperationException.class)
    public void testUnsupportBeforeWithoutIndex() throws Exception
    {
        SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );

        // test before()
        ForwardIndexEntry<String, Entry, Long> entry = new ForwardIndexEntry<String, Entry, Long>();
View Full Code Here


    @Test(expected = UnsupportedOperationException.class)
    public void testUnsupportAfterWithoutIndex() throws Exception
    {
        SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );

        // test before()
        ForwardIndexEntry<String, Entry, Long> entry = new ForwardIndexEntry<String, Entry, Long>();
View Full Code Here

        AndNode andNode = new AndNode();

        List<Evaluator<? extends ExprNode, Entry, Long>> evaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, Long>>();
        Evaluator<? extends ExprNode, Entry, Long> eval;

        ExprNode exprNode = new SubstringNode( schemaManager.getAttributeType( "cn" ), "J", null );
        eval = new SubstringEvaluator( (SubstringNode) exprNode, store, schemaManager );
        IndexCursor<?, Entry, Long> wrapped = new SubstringCursor( store, ( SubstringEvaluator ) eval );

        /* adding this results in NPE  adding Presence evaluator not
         Substring evaluator but adding Substring cursor as wrapped cursor */
 
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.shared.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.