View Javadoc
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;
22  
23  /**
24   * @author Manuel Laflamme
25   * @author Last changed by: $Author$
26   * @version $Revision$ $Date$
27   * @since 1.x (Apr 11, 2003)
28   */
29  public class ForwardOnlyDataSetTest extends DefaultDataSetTest
30  {
31      public ForwardOnlyDataSetTest(String s)
32      {
33          super(s);
34      }
35  
36      protected IDataSet createDataSet() throws Exception
37      {
38          return new ForwardOnlyDataSet(super.createDataSet());
39      }
40  
41      protected IDataSet createDuplicateDataSet() throws Exception
42      {
43          throw new UnsupportedOperationException();
44      }
45  
46      protected IDataSet createMultipleCaseDuplicateDataSet() throws Exception 
47      {
48          throw new UnsupportedOperationException();
49      }
50  
51      public void testGetTableNames() throws Exception
52      {
53          try
54          {
55              createDataSet().getTableNames();
56              fail("Should have throw UnsupportedOperationException");
57          }
58          catch (UnsupportedOperationException e)
59          {
60  
61          }
62      }
63  
64      public void testGetTable() throws Exception
65      {
66          String[] tableNames = getExpectedNames();
67          try
68          {
69              createDataSet().getTable(tableNames[0]);
70              fail("Should have throw UnsupportedOperationException");
71          }
72          catch (UnsupportedOperationException e)
73          {
74  
75          }
76      }
77  
78      public void testGetTableMetaData() throws Exception
79      {
80          String[] tableNames = getExpectedNames();
81          try
82          {
83              createDataSet().getTableMetaData(tableNames[0]);
84              fail("Should have throw UnsupportedOperationException");
85          }
86          catch (UnsupportedOperationException e)
87          {
88  
89          }
90      }
91  
92      public void testReverseIterator() throws Exception
93      {
94          try
95          {
96              createDataSet().reverseIterator();
97              fail("Should have throw UnsupportedOperationException");
98          }
99          catch (UnsupportedOperationException e)
100         {
101 
102         }
103     }
104 
105     public void testGetTableNamesDefensiveCopy() throws Exception
106     {
107         // Cannot test! Unsupported feature.
108     }
109 
110     public void testGetUnknownTable() throws Exception
111     {
112         // Cannot test! Unsupported feature.
113     }
114 
115     public void testGetUnknownTableMetaData() throws Exception
116     {
117         // Cannot test! Unsupported feature.
118     }
119 
120     public void testGetTablesDefensiveCopy() throws Exception
121     {
122         // Cannot test! Unsupported feature.
123     }
124 
125     public void testGetCaseInsensitiveTable() throws Exception
126     {
127         // Cannot test! Unsupported feature.
128     }
129 
130     public void testGetCaseInsensitiveTableMetaData() throws Exception
131     {
132         // Cannot test! Unsupported feature.
133     }
134 
135     public void testCreateDuplicateDataSet() throws Exception 
136     {
137         // No op. This dataSet is only a wrapper for another dataSet which is why duplicates cannot occur.
138     }
139 
140     public void testCreateMultipleCaseDuplicateDataSet() throws Exception 
141     {
142         // No op. This dataSet is only a wrapper for another dataSet which is why duplicates cannot occur.
143     }
144 
145     
146 }