1 21 22 package org.dbunit.dataset; 23 24 import org.dbunit.dataset.xml.XmlDataSet; 25 import org.dbunit.dataset.xml.XmlTableTest; 26 27 import java.io.File ; 28 import java.io.FileReader ; 29 import java.io.Reader ; 30 31 36 public class CaseInsensitiveTableTest extends XmlTableTest 37 { 38 public CaseInsensitiveTableTest(String s) 39 { 40 super(s); 41 } 42 43 protected ITable createTable() throws Exception 44 { 45 return new CaseInsensitiveTable(createDataSet().getTable("TEST_TABLE")); 46 } 47 48 protected IDataSet createDataSet() throws Exception 49 { 50 Reader in = new FileReader ( 51 new File ("src/xml/caseInsensitiveTableTest.xml")); 52 return new XmlDataSet(in); 53 } 54 55 public void testTableMetaData() throws Exception 56 { 57 Column[] columns = createTable().getTableMetaData().getColumns(); 58 assertEquals("column count", COLUMN_COUNT, columns.length); 59 for (int i = 0; i < columns.length; i++) 60 { 61 String expected = "COLUMN" + i; 62 String actual = columns[i].getColumnName(); 63 if (!actual.equalsIgnoreCase(expected)) 64 { 65 assertEquals("column name", expected, actual); 66 } 67 } 68 } 69 } 70 71 | Popular Tags |