1 21 package org.dbunit.dataset.filter; 22 23 import org.dbunit.dataset.*; 24 import org.dbunit.dataset.xml.XmlDataSet; 25 26 import java.io.FileReader ; 27 28 33 public abstract class AbstractTableFilterTest 34 extends AbstractTest 35 { 36 37 public AbstractTableFilterTest(String s) 38 { 39 super(s); 40 } 41 42 protected IDataSet createDataSet() throws Exception 43 { 44 IDataSet dataSet1 = new XmlDataSet( 45 new FileReader ("src/xml/dataSetTest.xml")); 46 IDataSet dataSet2 = new DefaultDataSet( 47 new DefaultTable(getExtraTableName())); 48 49 IDataSet dataSet = new CompositeDataSet(dataSet1, dataSet2); 50 assertEquals("count before filter", getExpectedNames().length + 1, 51 dataSet.getTableNames().length); 52 return dataSet; 53 } 54 55 protected IDataSet createDuplicateDataSet() throws Exception 56 { 57 IDataSet dataSet1 = new XmlDataSet( 58 new FileReader ("src/xml/xmlDataSetDuplicateTest.xml")); 59 IDataSet dataSet2 = new DefaultDataSet( 60 new DefaultTable(getExtraTableName())); 61 62 IDataSet dataSet = new CompositeDataSet(dataSet1, dataSet2, false); 63 assertEquals("count before filter", getExpectedDuplicateNames().length + 1, 64 dataSet.getTableNames().length); 65 return dataSet; 66 } 67 68 public abstract void testAccept() throws Exception ; 69 70 public abstract void testIsCaseInsensitiveValidName() throws Exception ; 71 72 public abstract void testIsValidNameAndInvalid() throws Exception ; 73 74 public abstract void testGetTableNames() throws Exception ; 75 76 public abstract void testGetDuplicateTableNames() throws Exception ; 77 78 public abstract void testGetCaseInsensitiveTableNames() throws Exception ; 79 80 public abstract void testGetReverseTableNames() throws Exception ; 81 82 public abstract void testGetTableNamesAndTableNotInDecoratedDataSet() throws Exception ; 83 84 public abstract void testIterator() throws Exception ; 85 86 public abstract void testIteratorWithDuplicateTables() throws Exception ; 87 88 public abstract void testCaseInsensitiveIterator() throws Exception ; 89 90 public abstract void testReverseIterator() throws Exception ; 91 92 public abstract void testIteratorAndTableNotInDecoratedDataSet() throws Exception ; 93 } 94 | Popular Tags |