1 package org.dbunit;
2
3 import junit.framework.TestCase;
4
5 import org.dbunit.dataset.DataSetException;
6 import org.dbunit.dataset.DefaultTable;
7 import org.dbunit.dataset.IDataSet;
8 import org.dbunit.dataset.ITable;
9 import org.dbunit.util.fileloader.DataFileLoader;
10 import org.dbunit.util.fileloader.FlatXmlDataFileLoader;
11
12 public class DefaultPrepAndExpectedTestCaseTest extends TestCase {
13 private static final String PREP_DATA_FILE_NAME = "/xml/flatXmlDataSetTest.xml";
14 private static final String EXP_DATA_FILE_NAME = "/xml/flatXmlDataSetTest.xml";
15
16 private final DataFileLoader dataFileLoader = new FlatXmlDataFileLoader();
17
18
19
20 private final DefaultPrepAndExpectedTestCase tc =
21 new DefaultPrepAndExpectedTestCase();
22
23 protected void setUp() throws Exception {
24 super.setUp();
25
26 tc.setDataFileLoader(dataFileLoader);
27 }
28
29 public void testConfigureTest() throws Exception {
30 String[] prepDataFiles = {PREP_DATA_FILE_NAME};
31 String[] expectedDataFiles = {EXP_DATA_FILE_NAME};
32 VerifyTableDefinition[] tables = {};
33
34 tc.configureTest(tables, prepDataFiles, expectedDataFiles);
35
36 assertEquals("Configured tables do not match expected.", tables, tc
37 .getTableDefs());
38
39 IDataSet expPrepDs = dataFileLoader.load(PREP_DATA_FILE_NAME);
40 Assertion.assertEquals(expPrepDs, tc.getPrepDataset());
41
42 IDataSet expExpDs = dataFileLoader.load(EXP_DATA_FILE_NAME);
43 Assertion.assertEquals(expExpDs, tc.getExpectedDataset());
44 }
45
46 public void testPreTest() throws Exception {
47
48 }
49
50 public void testPostTest() {
51
52 }
53
54 public void testPostTest_false() {
55
56 }
57
58 public void testSetupData() {
59
60 }
61
62 public void testVerifyData() {
63
64 }
65
66 public void testVerifyDataITableITableStringArrayStringArray() {
67
68 }
69
70 public void testCleanupData() {
71
72 }
73
74 public void testMakeCompositeDataSet() {
75
76 }
77
78
79 public void testApplyColumnFiltersBothNull() throws DataSetException {
80 final ITable table = new DefaultTable("test_table");
81 final String[] excludeColumns = null;
82 final String[] includeColumns = null;
83 tc.applyColumnFilters(table, excludeColumns, includeColumns);
84 }
85
86
87 public void testApplyColumnFiltersBothNotNull() throws DataSetException {
88 final ITable table = new DefaultTable("test_table");
89 final String[] excludeColumns = {"COL1"};
90 final String[] includeColumns = {"COL2"};
91 tc.applyColumnFilters(table, excludeColumns, includeColumns);
92 }
93 }