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.ArrayLongList; 27 import org.apache.commons.collections.primitives.RandomAccessLongList; 28 29 33 public class TestLongListList extends BaseTestList { 34 35 38 public TestLongListList(String testName) { 39 super(testName); 40 } 41 42 public static Test suite() { 43 TestSuite suite = BulkTest.makeSuite(TestLongListList.class); 44 return suite; 45 } 46 47 50 public List makeEmptyList() { 51 return new LongListList(new ArrayLongList()); 52 } 53 54 public Object [] getFullElements() { 55 Long [] elts = new Long [10]; 56 for(int i=0;i<elts.length;i++) { 57 elts[i] = new Long (i); 58 } 59 return elts; 60 } 61 62 public Object [] getOtherElements() { 63 Long [] elts = new Long [10]; 64 for(int i=0;i<elts.length;i++) { 65 elts[i] = new Long (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(LongListList.wrap(null)); 97 } 98 99 public void testWrapSerializable() { 100 List list = LongListList.wrap(new ArrayLongList()); 101 assertNotNull(list); 102 assertTrue(list instanceof Serializable ); 103 } 104 105 public void testWrapNonSerializable() { 106 List list = LongListList.wrap(new RandomAccessLongList() { 107 public long 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 |