Package org.apache.commons.collections.primitives

Examples of org.apache.commons.collections.primitives.FloatCollection


    public void testWrapNull() {
        assertNull(CollectionFloatCollection.wrap(null));
    }
   
    public void testWrapSerializable() {
        FloatCollection collection = CollectionFloatCollection.wrap(new ArrayList());
        assertNotNull(collection);
        assertTrue(collection instanceof Serializable);
    }
View Full Code Here


        assertNotNull(collection);
        assertTrue(collection instanceof Serializable);
    }
   
    public void testWrapNonSerializable() {
        FloatCollection collection = CollectionFloatCollection.wrap(new AbstractList() {
            public Object get(int i) { throw new IndexOutOfBoundsException(); }
            public int size() { return 0; }
        });
        assertNotNull(collection);
        assertTrue(!(collection instanceof Serializable));
View Full Code Here

    // tests
    // ------------------------------------------------------------------------
   
    public void testCollectionCallsAreProxied() {
        final InvocationCounter proxied = new InvocationCounter();
        FloatCollection collection = new BaseProxyFloatCollection() {
            protected FloatCollection getProxiedCollection() {
                return proxied;
            }
        };
       
        assertEquals(0,proxied.getAddCount());
        collection.add((float)1);
        assertEquals(1,proxied.getAddCount());

        assertEquals(0,proxied.getAddAllCount());
        collection.addAll(null);
        assertEquals(1,proxied.getAddAllCount());
       
        assertEquals(0,proxied.getClearCount());
        collection.clear();
        assertEquals(1,proxied.getClearCount());

        assertEquals(0,proxied.getContainsCount());
        collection.contains((float)1);
        assertEquals(1,proxied.getContainsCount());

        assertEquals(0,proxied.getContainsAllCount());
        collection.containsAll(null);
        assertEquals(1,proxied.getContainsAllCount());

        assertEquals(0,proxied.getIsEmptyCount());
        collection.isEmpty();
        assertEquals(1,proxied.getIsEmptyCount());

        assertEquals(0,proxied.getIteratorCount());
        collection.iterator();
        assertEquals(1,proxied.getIteratorCount());

        assertEquals(0,proxied.getRemoveAllCount());
        collection.removeAll(null);
        assertEquals(1,proxied.getRemoveAllCount());

        assertEquals(0,proxied.getRetainAllCount());
        collection.retainAll(null);
        assertEquals(1,proxied.getRetainAllCount());

        assertEquals(0,proxied.getRemoveElementCount());
        collection.removeElement((float)1);
        assertEquals(1,proxied.getRemoveElementCount());

        assertEquals(0,proxied.getSizeCount());
        collection.size();
        assertEquals(1,proxied.getSizeCount());

        assertEquals(0,proxied.getToArrayFloatArrayCount());
        collection.toArray(new float[0]);
        assertEquals(1,proxied.getToArrayFloatArrayCount());
       
        assertEquals(0,proxied.getToArrayCount());
        collection.toArray();
        assertEquals(1,proxied.getToArrayCount());
       
        assertEquals(0,proxied.getToStringCount());
        collection.toString();
        assertEquals(1,proxied.getToStringCount());
       
        assertEquals(0,proxied.getEqualsCount());
        collection.equals(null);
        assertEquals(1,proxied.getEqualsCount());
       
        assertEquals(0,proxied.getHashCodeCount());
        collection.hashCode();
        assertEquals(1,proxied.getHashCodeCount());
       
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.primitives.FloatCollection

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.