Package com.hazelcast.core

Examples of com.hazelcast.core.IList


//    ================== Remove ====================

    @Test
    public void testRemoveIndex() {
        IList list = newList_withInitialData(10);
        assertEquals("item0", list.remove(0));
        assertEquals("item4", list.remove(3));
        assertEquals("item7", list.remove(5));
    }
View Full Code Here


        assertEquals("item7", list.remove(5));
    }

    @Test(expected = IndexOutOfBoundsException.class)
    public void testRemoveIndex_whenIndexNegative() {
        IList list = newList();
        list.remove(-1);
    }
View Full Code Here

        list.remove(-1);
    }

    @Test(expected = IndexOutOfBoundsException.class)
    public void testRemoveIndex_whenIndexNotExists() {
        IList list = newList_withInitialData(10);
        list.remove(14);
    }
View Full Code Here

        list.remove(14);
    }

    @Test(expected = IndexOutOfBoundsException.class)
    public void testRemoveIndex_whenListEmpty() {
        IList list = newList();
        list.remove(0);
    }
View Full Code Here

        list.remove(0);
    }

    @Test
    public void testRemoveObject() {
        IList list = newList();
        list.add("item0");
        list.add("item1");
        list.add("item2");
        list.add("item0");

        assertTrue(list.remove("item0"));
        assertFalse(list.remove("item3"));
        assertEquals("item1", list.get(0));
        assertEquals("item0", list.get(2));
    }
View Full Code Here

        assertEquals("item0", list.get(2));
    }

    @Test(expected = NullPointerException.class)
    public void testRemoveObject_whenObjectNull() {
        IList list = newList();
        list.remove(null);
    }
View Full Code Here

        list.remove(null);
    }

    @Test
    public void testRemoveObject_whenListEmpty() {
        IList list = newList();
        assertFalse(list.remove("item0"));
    }
View Full Code Here

//    ====================== RemoveAll ======================

    @Test
    public void testRemoveAll() {
        IList list = newList_withInitialData(10);
        List listTest = new ArrayList<String>();
        listTest.add("item0");
        listTest.add("item1");
        listTest.add("item2");


        assertTrue(list.removeAll(listTest));
        assertEquals(7, list.size());
        assertEquals("item3", list.get(0));
    }
View Full Code Here

        assertEquals("item3", list.get(0));
    }

    @Test(expected = NullPointerException.class)
    public void testRemoveAll_whenCollectionNull() {
        IList list = newList();
        list.removeAll(null);
    }
View Full Code Here

        list.removeAll(null);
    }

    @Test
    public void testRemoveAll_whenCollectionEmpty() {
        IList list = newList_withInitialData(10);
        List listTest = new ArrayList<String>();
        assertFalse(list.removeAll(listTest));
        assertEquals(10, list.size());
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.IList

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.