1 7 package org.jdesktop.swing.data; 8 9 import javax.swing.table.TableModel ; 10 11 import junit.framework.TestCase; 12 13 import org.jdesktop.swing.util.DataSetTestSupport; 14 15 20 public class DMToTableModelAdapterTest extends TestCase { 21 22 23 24 private MetaData[] defaultMetaData; 25 26 public void testColumnName() { 27 TableModel adapter = new DataModelToTableModelAdapter(createFilledDataModel()); 28 for (int i = 0; i < defaultMetaData.length; i++) { 29 assertEquals("column name must be equal to metadata label", 30 defaultMetaData[i].getLabel(), adapter.getColumnName(i)); 31 } 32 } 33 protected TabularDataModel createFilledDataModel() { 34 return DataSetTestSupport.createDefaultFilledTabularDataModel(3); 35 36 } 37 38 protected void setUp() throws Exception { 39 super.setUp(); 40 defaultMetaData = DataSetTestSupport.createDefaultMetaData(); 41 } 42 } 43 | Popular Tags |