1 17 package org.apache.commons.collections.primitives.adapters; 18 19 import java.io.Serializable ; 20 import java.util.AbstractList ; 21 import java.util.ArrayList ; 22 import java.util.List ; 23 24 import junit.framework.Test; 25 import junit.framework.TestSuite; 26 27 import org.apache.commons.collections.AbstractTestObject; 28 import org.apache.commons.collections.primitives.FloatCollection; 29 30 34 public class TestCollectionFloatCollection extends AbstractTestObject { 35 36 39 public TestCollectionFloatCollection(String testName) { 40 super(testName); 41 } 42 43 public static Test suite() { 44 return new TestSuite(TestCollectionFloatCollection.class); 45 } 46 47 50 public Object makeObject() { 51 List list = new ArrayList (); 52 for(int i=0;i<10;i++) { 53 list.add(new Float ((float)i)); 54 } 55 return new CollectionFloatCollection(list); 56 } 57 58 public void testSerializeDeserializeThenCompare() { 59 } 61 62 63 public void testCanonicalEmptyCollectionExists() { 64 } 67 68 public void testCanonicalFullCollectionExists() { 69 } 72 73 76 public void testWrapNull() { 77 assertNull(CollectionFloatCollection.wrap(null)); 78 } 79 80 public void testWrapSerializable() { 81 FloatCollection collection = CollectionFloatCollection.wrap(new ArrayList ()); 82 assertNotNull(collection); 83 assertTrue(collection instanceof Serializable ); 84 } 85 86 public void testWrapNonSerializable() { 87 FloatCollection collection = CollectionFloatCollection.wrap(new AbstractList () { 88 public Object get(int i) { throw new IndexOutOfBoundsException (); } 89 public int size() { return 0; } 90 }); 91 assertNotNull(collection); 92 assertTrue(!(collection instanceof Serializable )); 93 } 94 95 } 96 | Popular Tags |