1 42 43 package org.jfree.util.junit; 44 45 import java.awt.Color ; 46 47 import junit.framework.Test; 48 import junit.framework.TestCase; 49 import junit.framework.TestSuite; 50 51 import org.jfree.util.ObjectTable; 52 53 56 public class ObjectTableTests extends TestCase { 57 58 61 public class TObjectTable extends ObjectTable { 62 63 66 public TObjectTable() { 67 super(); 68 } 69 70 79 public Object getObject(final int row, final int column) { 80 return super.getObject(row, column); 81 } 82 83 90 public void setObject(final int row, final int column, final Object object) { 91 super.setObject(row, column, object); 92 } 93 } 94 95 100 public static Test suite() { 101 return new TestSuite(ObjectTableTests.class); 102 } 103 104 109 public ObjectTableTests(final String name) { 110 super(name); 111 } 112 113 116 public void testCreate() { 117 118 final TObjectTable t = new TObjectTable(); 119 120 assertEquals(t.getColumnCount(), 0); 122 assertEquals(t.getRowCount(), 0); 123 124 assertNull(t.getObject(0, 0)); 126 assertNull(t.getObject(12, 12)); 127 128 } 129 130 134 public void testSetObject1() { 135 136 final TObjectTable t = new TObjectTable(); 137 t.setObject(8, 5, Color.red); 138 assertEquals(6, t.getColumnCount()); 139 assertEquals(9, t.getRowCount()); 140 assertNull(t.getObject(7, 4)); 141 assertEquals(Color.red, t.getObject(8, 5)); 142 143 } 144 145 } 146 | Popular Tags |