1 21 22 package org.dbunit.dataset; 23 24 import org.dbunit.dataset.xml.FlatXmlDataSet; 25 26 import java.io.File ; 27 28 32 public class SortedTableTest extends AbstractTableTest 33 { 34 public SortedTableTest(String s) 35 { 36 super(s); 37 } 38 39 protected ITable createTable() throws Exception 40 { 41 return createDataSet().getTable("TEST_TABLE"); 42 } 43 44 protected IDataSet createDataSet() throws Exception 45 { 46 return new SortedDataSet(new FlatXmlDataSet( 47 new File ("src/xml/sortedTableTest.xml"))); 48 } 49 50 public void testGetMissingValue() throws Exception 51 { 52 String columnName = "COLUMN2"; 53 Object [] expected = {null, null, null, "0", "1"}; 54 55 ITable table = createDataSet().getTable("MISSING_VALUES"); 56 57 Column[] columns = table.getTableMetaData().getColumns(); 58 assertEquals("column count", 3, columns.length); 59 assertEquals("row count", 5, table.getRowCount()); 60 for (int i = 0; i < table.getRowCount(); i++) 61 { 62 assertEquals("value row " + i, expected[i], 63 table.getValue(i, columnName)); 64 } 65 } 66 67 68 } 69 70 71 72 73 74 75 76 77 78 | Popular Tags |