Examples of ArrayEnumeration


Examples of org.apache.directory.api.util.ArrayEnumeration

    {
        // test with null array

        Object[] array = null;

        ArrayEnumeration list = new ArrayEnumeration( array );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with empty array

        array = new Object[0];

        list = new ArrayEnumeration( array );

        assertFalse( list.hasMoreElements() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with one object

        array = new Object[]
            { new Object() };

        list = new ArrayEnumeration( array );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with two objects

        array = new Object[]
            { new Object(), new Object() };

        list = new ArrayEnumeration( array );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with three elements

        array = new Object[]
            { new Object(), new Object(), new Object() };

        list = new ArrayEnumeration( array );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
View Full Code Here

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

    {
        // test with null array

        Object[] array = null;

        ArrayEnumeration list = new ArrayEnumeration( array );

        assertFalse(list.hasMoreElements());

        try
        {
            list.nextElement();

            fail("should never get here due to a NoSuchElementException");
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with empty array

        array = new Object[0];

        list = new ArrayEnumeration( array );

        assertFalse(list.hasMoreElements());

        assertFalse(list.hasMoreElements());

        try
        {
            list.nextElement();

            fail("should never get here due to a NoSuchElementException");
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with one object

        array = new Object[]
            { new Object() };

        list = new ArrayEnumeration( array );

        assertTrue(list.hasMoreElements());

        assertNotNull(list.nextElement());

        assertFalse(list.hasMoreElements());

        try
        {
            list.nextElement();

            fail("should never get here due to a NoSuchElementException");
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with two objects

        array = new Object[]
            { new Object(), new Object() };

        list = new ArrayEnumeration( array );

        assertTrue(list.hasMoreElements());

        assertNotNull(list.nextElement());

        assertTrue(list.hasMoreElements());

        assertNotNull(list.nextElement());

        assertFalse(list.hasMoreElements());

        try
        {
            list.nextElement();

            fail("should never get here due to a NoSuchElementException");
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with three elements

        array = new Object[]
            { new Object(), new Object(), new Object() };

        list = new ArrayEnumeration( array );

        assertTrue(list.hasMoreElements());

        assertNotNull(list.nextElement());

        assertTrue(list.hasMoreElements());

        assertNotNull(list.nextElement());

        assertTrue(list.hasMoreElements());

        assertNotNull(list.nextElement());

        assertFalse(list.hasMoreElements());

        try
        {
            list.nextElement();

            fail("should never get here due to a NoSuchElementException");
        }
        catch ( NoSuchElementException e )
        {
View Full Code Here

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

    {
        // test with null array

        Object[] array = null;

        ArrayEnumeration list = new ArrayEnumeration( array );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with empty array

        array = new Object[0];

        list = new ArrayEnumeration( array );

        assertFalse( list.hasMoreElements() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with one object

        array = new Object[]
            { new Object() };

        list = new ArrayEnumeration( array );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with two objects

        array = new Object[]
            { new Object(), new Object() };

        list = new ArrayEnumeration( array );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
        }

        // test with three elements

        array = new Object[]
            { new Object(), new Object(), new Object() };

        list = new ArrayEnumeration( array );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertTrue( list.hasMoreElements() );

        assertNotNull( list.nextElement() );

        assertFalse( list.hasMoreElements() );

        try
        {
            list.nextElement();

            fail( "should never get here due to a NoSuchElementException" );
        }
        catch ( NoSuchElementException e )
        {
View Full Code Here

Examples of org.apache.openejb.client.ArrayEnumeration

        return attributes.get(s);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return new ArrayEnumeration(new ArrayList(attributes.keySet()));
    }
View Full Code Here

Examples of org.apache.openejb.client.ArrayEnumeration

        return attributes.get(s);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return new ArrayEnumeration(new ArrayList(attributes.keySet()));
    }
View Full Code Here

Examples of org.apache.openejb.client.ArrayEnumeration

        return attributes.get(s);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return new ArrayEnumeration(new ArrayList(attributes.keySet()));
    }
View Full Code Here

Examples of org.apache.openejb.client.ArrayEnumeration

        return attributes.get(s);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return new ArrayEnumeration(new ArrayList(attributes.keySet()));
    }
View Full Code Here

Examples of org.apache.openejb.client.ArrayEnumeration

        return attributes.get(s);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return new ArrayEnumeration(new ArrayList(attributes.keySet()));
    }
View Full Code Here

Examples of org.apache.openejb.util.ArrayEnumeration

        return headers.get(name);
    }

    @Override
    public Enumeration<String> getHeaderNames() {
        return new ArrayEnumeration(new ArrayList<String>(headers.keySet()));
    }
View Full Code Here

Examples of org.apache.openejb.util.ArrayEnumeration

        return new ArrayEnumeration(new ArrayList<String>(headers.keySet()));
    }

    @Override
    public Enumeration<String> getHeaders(String s) {
        return new ArrayEnumeration(Arrays.asList(headers.get(s)));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.