1 17 package org.apache.commons.collections.primitives.adapters; 18 19 import java.io.Serializable ; 20 import java.util.List ; 21 22 import junit.framework.Test; 23 import junit.framework.TestSuite; 24 25 import org.apache.commons.collections.BulkTest; 26 import org.apache.commons.collections.primitives.ArrayCharList; 27 import org.apache.commons.collections.primitives.RandomAccessCharList; 28 29 33 public class TestCharListList extends BaseTestList { 34 35 38 public TestCharListList(String testName) { 39 super(testName); 40 } 41 42 public static Test suite() { 43 TestSuite suite = BulkTest.makeSuite(TestCharListList.class); 44 return suite; 45 } 46 47 50 public List makeEmptyList() { 51 return new CharListList(new ArrayCharList()); 52 } 53 54 public Object [] getFullElements() { 55 Character [] elts = new Character [10]; 56 for(int i=0;i<elts.length;i++) { 57 elts[i] = new Character ((char)i); 58 } 59 return elts; 60 } 61 62 public Object [] getOtherElements() { 63 Character [] elts = new Character [10]; 64 for(int i=0;i<elts.length;i++) { 65 elts[i] = new Character ((char)(10 + i)); 66 } 67 return elts; 68 } 69 70 73 74 75 public void testCanonicalEmptyCollectionExists() { 76 } 79 80 public void testCanonicalFullCollectionExists() { 81 } 84 85 public void testEmptyListCompatibility() { 86 } 89 90 public void testFullListCompatibility() { 91 } 94 95 public void testWrapNull() { 96 assertNull(CharListList.wrap(null)); 97 } 98 99 public void testWrapSerializable() { 100 List list = CharListList.wrap(new ArrayCharList()); 101 assertNotNull(list); 102 assertTrue(list instanceof Serializable ); 103 } 104 105 public void testWrapNonSerializable() { 106 List list = CharListList.wrap(new RandomAccessCharList() { 107 public char get(int i) { throw new IndexOutOfBoundsException (); } 108 public int size() { return 0; } 109 }); 110 assertNotNull(list); 111 assertTrue(!(list instanceof Serializable )); 112 } 113 } 114 | Popular Tags |