Package org.apache.directory.shared.util

Examples of org.apache.directory.shared.util.JoinIterator


    @Test
    public void testNullArgument()
    {
        try
        {
            new JoinIterator( null );
            fail( "Should not be able to create a JoinIterator with null args" );
        }
        catch ( IllegalArgumentException e )
        {
            assertNotNull( e );
View Full Code Here


        Iterator<?>[] iterators = new Iterator<?>[]
            { Collections.singleton( "foo" ).iterator() };

        try
        {
            new JoinIterator( iterators );
            fail( "Should not be able to create a JoinIterator with a single Iterator" );
        }
        catch ( IllegalArgumentException e )
        {
            assertNotNull( e );
View Full Code Here

    public void testTwoArguments()
    {
        Iterator<?>[] iterators = new Iterator<?>[]
            { Collections.singleton( "foo" ).iterator(), Collections.singleton( "bar" ).iterator() };

        JoinIterator iterator = new JoinIterator( iterators );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "foo", iterator.next() );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "bar", iterator.next() );
        assertFalse( "iterator should NOT have an element", iterator.hasNext() );
    }
View Full Code Here

        Iterator<?>[] iterators = new Iterator<?>[]
            { Collections.singleton( "foo0" ).iterator(), multivalued.iterator(),
                Collections.singleton( "bar0" ).iterator(), Collections.singleton( "bar1" ).iterator() };

        JoinIterator iterator = new JoinIterator( iterators );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "foo0", iterator.next() );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "foo1", iterator.next() );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "foo2", iterator.next() );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "bar0", iterator.next() );
        assertTrue( "iterator should have an element", iterator.hasNext() );
        assertEquals( "bar1", iterator.next() );
        assertFalse( "iterator should NOT have an element", iterator.hasNext() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.util.JoinIterator

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.