KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > dbunit > dataset > filter > AbstractTableFilterTest


1 /*
2  *
3  * The DbUnit Database Testing Framework
4  * Copyright (C)2002-2004, DbUnit.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */

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 JavaDoc;
27
28 /**
29  * @author Manuel Laflamme
30  * @since Mar 9, 2003
31  * @version $Revision: 1.6 $
32  */

33 public abstract class AbstractTableFilterTest
34         extends AbstractTest
35 {
36
37     public AbstractTableFilterTest(String JavaDoc s)
38     {
39         super(s);
40     }
41
42     protected IDataSet createDataSet() throws Exception JavaDoc
43     {
44         IDataSet dataSet1 = new XmlDataSet(
45                 new FileReader JavaDoc("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 JavaDoc
56     {
57         IDataSet dataSet1 = new XmlDataSet(
58                 new FileReader JavaDoc("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 JavaDoc;
69
70     public abstract void testIsCaseInsensitiveValidName() throws Exception JavaDoc;
71
72     public abstract void testIsValidNameAndInvalid() throws Exception JavaDoc;
73
74     public abstract void testGetTableNames() throws Exception JavaDoc;
75
76     public abstract void testGetDuplicateTableNames() throws Exception JavaDoc;
77
78     public abstract void testGetCaseInsensitiveTableNames() throws Exception JavaDoc;
79
80     public abstract void testGetReverseTableNames() throws Exception JavaDoc;
81
82     public abstract void testGetTableNamesAndTableNotInDecoratedDataSet() throws Exception JavaDoc;
83
84     public abstract void testIterator() throws Exception JavaDoc;
85
86     public abstract void testIteratorWithDuplicateTables() throws Exception JavaDoc;
87
88     public abstract void testCaseInsensitiveIterator() throws Exception JavaDoc;
89
90     public abstract void testReverseIterator() throws Exception JavaDoc;
91
92     public abstract void testIteratorAndTableNotInDecoratedDataSet() throws Exception JavaDoc;
93 }
94
Popular Tags