View Javadoc
1   /*
2    *
3    * The DbUnit Database Testing Framework
4    * Copyright (C)2002-2008, 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;
22  
23  import java.util.ArrayList;
24  import java.util.Arrays;
25  import java.util.List;
26  import java.util.Map;
27  
28  import org.dbunit.database.DatabaseConfig;
29  import org.dbunit.assertion.comparer.value.ValueComparer;
30  import org.dbunit.assertion.comparer.value.verifier.DefaultValueComparerAndVerifyTableDefinitionVerifier;
31  import org.dbunit.assertion.comparer.value.verifier.ValueComparerAndVerifyTableDefinitionVerifier;
32  import org.dbunit.database.IDatabaseConnection;
33  import org.dbunit.dataset.Column;
34  import org.dbunit.dataset.CompositeDataSet;
35  import org.dbunit.dataset.DataSetException;
36  import org.dbunit.dataset.DefaultDataSet;
37  import org.dbunit.dataset.IDataSet;
38  import org.dbunit.dataset.ITable;
39  import org.dbunit.dataset.SortedTable;
40  import org.dbunit.dataset.filter.DefaultColumnFilter;
41  import org.dbunit.operation.DatabaseOperation;
42  import org.dbunit.util.fileloader.DataFileLoader;
43  import org.slf4j.Logger;
44  import org.slf4j.LoggerFactory;
45  
46  //TODO update JavaDoc with ValueComparer uses
47  //TODO move docs to a new site page
48  /**
49   * Test case base class supporting prep data and expected data. Prep data is the
50   * data needed for the test to run. Expected data is the data needed to compare
51   * if the test ran successfully.
52   *
53   * @see org.dbunit.DefaultPrepAndExpectedTestCaseDiIT
54   * @see org.dbunit.DefaultPrepAndExpectedTestCaseExtIT
55   *
56   * @author Jeff Jensen jeffjensen AT users.sourceforge.net
57   * @author Last changed by: $Author$
58   * @version $Revision$ $Date$
59   * @since 2.4.8
60   */
61  public class DefaultPrepAndExpectedTestCase extends DBTestCase
62          implements PrepAndExpectedTestCase
63  {
64      private final Logger log =
65              LoggerFactory.getLogger(DefaultPrepAndExpectedTestCase.class);
66  
67      private static final String DATABASE_TESTER_IS_NULL_MSG =
68              "databaseTester is null; must configure or set it first";
69  
70      public static final String TEST_ERROR_MSG = "DbUnit test error.";
71  
72      private IDatabaseTester databaseTester;
73      private DataFileLoader dataFileLoader;
74  
75      // per test data
76      private IDataSet prepDataSet = new DefaultDataSet();
77      private IDataSet expectedDataSet = new DefaultDataSet();
78      private VerifyTableDefinition[] verifyTableDefs = {};
79  
80      private ExpectedDataSetAndVerifyTableDefinitionVerifier expectedDataSetAndVerifyTableDefinitionVerifier =
81              new DefaultExpectedDataSetAndVerifyTableDefinitionVerifier();
82  
83      private ValueComparer defaultValueComparer;
84      private Map<String, Map<String, ValueComparer>> tableColumnValueComparers;
85  
86      private ValueComparerAndVerifyTableDefinitionVerifier valueComparerAndVerifyTableDefinitionVerifier =
87              new DefaultValueComparerAndVerifyTableDefinitionVerifier();
88  
89      /** Create new instance. */
90      public DefaultPrepAndExpectedTestCase()
91      {
92      }
93  
94      /**
95       * Create new instance with specified dataFileLoader and databaseTester.
96       *
97       * @param dataFileLoader
98       *            Load to use for loading the data files.
99       * @param databaseTester
100      *            Tester to use for database manipulation.
101      */
102     public DefaultPrepAndExpectedTestCase(final DataFileLoader dataFileLoader,
103             final IDatabaseTester databaseTester)
104     {
105         this.dataFileLoader = dataFileLoader;
106         this.databaseTester = databaseTester;
107     }
108 
109     /**
110      * Create new instance with specified test case name.
111      *
112      * @param name
113      *            The test case name.
114      */
115     public DefaultPrepAndExpectedTestCase(final String name)
116     {
117         super(name);
118     }
119 
120     /**
121      * {@inheritDoc} This implementation returns the databaseTester set by the
122      * test.
123      */
124     @Override
125     public IDatabaseTester newDatabaseTester() throws Exception
126     {
127         // questionable, but there is not a "setter" for any parent...
128         return databaseTester;
129     }
130 
131     /**
132      * {@inheritDoc} Returns the prep dataset.
133      */
134     @Override
135     public IDataSet getDataSet() throws Exception
136     {
137         return prepDataSet;
138     }
139 
140     /**
141      * {@inheritDoc}
142      */
143     public void configureTest(
144             final VerifyTableDefinition[] verifyTableDefinitions,
145             final String[] prepDataFiles, final String[] expectedDataFiles)
146             throws Exception
147     {
148         log.info("configureTest: saving instance variables");
149         this.prepDataSet = makeCompositeDataSet(prepDataFiles, "prep");
150         this.expectedDataSet =
151                 makeCompositeDataSet(expectedDataFiles, "expected");
152         this.verifyTableDefs = verifyTableDefinitions;
153     }
154 
155     /**
156      * {@inheritDoc}
157      */
158     public void configureTest(
159             final VerifyTableDefinition[] verifyTableDefinitions,
160             final String[] prepDataFiles, final String[] expectedDataFiles,
161             final ValueComparer defaultValueComparer,
162             final Map<String, Map<String, ValueComparer>> tableColumnValueComparers)
163             throws Exception
164     {
165         configureTest(verifyTableDefinitions, prepDataFiles, expectedDataFiles);
166         this.defaultValueComparer = defaultValueComparer;
167         this.tableColumnValueComparers = tableColumnValueComparers;
168     }
169 
170     /**
171      * {@inheritDoc}
172      */
173     public void preTest() throws Exception
174     {
175         setupData();
176     }
177 
178     /**
179      * {@inheritDoc}
180      */
181     public void preTest(final VerifyTableDefinition[] tables,
182             final String[] prepDataFiles, final String[] expectedDataFiles)
183             throws Exception
184     {
185         configureTest(tables, prepDataFiles, expectedDataFiles);
186         preTest();
187     }
188 
189     /**
190      * {@inheritDoc}
191      */
192     public void preTest(final VerifyTableDefinition[] tables,
193             final String[] prepDataFiles, final String[] expectedDataFiles,
194             final ValueComparer defaultValueComparer,
195             final Map<String, Map<String, ValueComparer>> tableColumnValueComparers)
196             throws Exception
197     {
198         configureTest(tables, prepDataFiles, expectedDataFiles,
199                 defaultValueComparer, tableColumnValueComparers);
200         preTest();
201     }
202 
203     /**
204      * {@inheritDoc}
205      */
206     public Object runTest(final VerifyTableDefinition[] verifyTables,
207             final String[] prepDataFiles, final String[] expectedDataFiles,
208             final PrepAndExpectedTestCaseSteps testSteps) throws Exception
209     {
210         return runTest(verifyTables, prepDataFiles, expectedDataFiles, null,
211                 null, testSteps);
212     }
213 
214     /**
215      * {@inheritDoc}
216      */
217     public Object runTest(final VerifyTableDefinition[] verifyTables,
218             final String[] prepDataFiles, final String[] expectedDataFiles,
219             final ValueComparer defaultValueComparer,
220             final Map<String, Map<String, ValueComparer>> tableColumnValueComparers,
221             final PrepAndExpectedTestCaseSteps testSteps) throws Exception
222     {
223         final Object result;
224 
225         try
226         {
227             preTest(verifyTables, prepDataFiles, expectedDataFiles,
228                     defaultValueComparer, tableColumnValueComparers);
229             log.info("runTest: running test steps");
230             result = testSteps.run();
231         } catch (final Exception e)
232         {
233             log.error(TEST_ERROR_MSG, e);
234             // don't verify table data when test execution has errors as:
235             // * a verify data failure masks the test error exception
236             // * tables in unknown state and therefore probably not accurate
237             postTest(false);
238             throw e;
239         }
240 
241         postTest();
242 
243         return result;
244     }
245 
246     /**
247      * {@inheritDoc}
248      */
249     public void postTest() throws Exception
250     {
251         postTest(true);
252     }
253 
254     /**
255      * {@inheritDoc}
256      */
257     public void postTest(final boolean verifyData) throws Exception
258     {
259         try
260         {
261             if (verifyData)
262             {
263                 verifyData();
264             }
265         } finally
266         {
267             // it is deliberate to have cleanup exceptions shadow verify
268             // failures so user knows db is probably in unknown state (for
269             // those not using an in-memory db or transaction rollback),
270             // otherwise would mask probable cause of subsequent test failures
271             cleanupData();
272         }
273     }
274 
275     /**
276      * {@inheritDoc}
277      */
278     public void cleanupData() throws Exception
279     {
280         try
281         {
282             final IDataSet dataset =
283                     new CompositeDataSet(prepDataSet, expectedDataSet);
284             final String[] tableNames = dataset.getTableNames();
285             final int count = tableNames.length;
286             log.info("cleanupData: about to clean up {} tables={}", count,
287                     tableNames);
288 
289             if (databaseTester == null)
290             {
291                 throw new IllegalStateException(DATABASE_TESTER_IS_NULL_MSG);
292             }
293 
294             databaseTester.setTearDownOperation(getTearDownOperation());
295             databaseTester.setDataSet(dataset);
296             databaseTester.setOperationListener(getOperationListener());
297             databaseTester.onTearDown();
298             log.debug("cleanupData: Clean up done");
299         } catch (final Exception e)
300         {
301             log.error("cleanupData: Exception:", e);
302             throw e;
303         }
304     }
305 
306     @Override
307     protected void tearDown() throws Exception
308     {
309         // parent tearDown() only cleans up prep data
310         cleanupData();
311         super.tearDown();
312     }
313 
314     /**
315      * Use the provided databaseTester to prep the database with the provided
316      * prep dataset. See {@link org.dbunit.IDatabaseTester#onSetup()}.
317      *
318      * @throws Exception
319      */
320     public void setupData() throws Exception
321     {
322         log.info("setupData: setting prep dataset and inserting rows");
323         if (databaseTester == null)
324         {
325             throw new IllegalStateException(DATABASE_TESTER_IS_NULL_MSG);
326         }
327 
328         try
329         {
330             super.setUp();
331         } catch (final Exception e)
332         {
333             log.error("setupData: Exception with setting up data:", e);
334             throw e;
335         }
336     }
337 
338     @Override
339     protected DatabaseOperation getSetUpOperation() throws Exception
340     {
341         assertNotNull(DATABASE_TESTER_IS_NULL_MSG, databaseTester);
342         return databaseTester.getSetUpOperation();
343     }
344 
345     @Override
346     protected DatabaseOperation getTearDownOperation() throws Exception
347     {
348         assertNotNull(DATABASE_TESTER_IS_NULL_MSG, databaseTester);
349         return databaseTester.getTearDownOperation();
350     }
351 
352     /**
353      * {@inheritDoc} Uses the connection from the provided databaseTester.
354      */
355     public void verifyData() throws Exception
356     {
357         if (databaseTester == null)
358         {
359             throw new IllegalStateException(DATABASE_TESTER_IS_NULL_MSG);
360         }
361 
362         valueComparerAndVerifyTableDefinitionVerifier
363                 .verify(tableColumnValueComparers, verifyTableDefs);
364 
365         final IDatabaseConnection connection = getConnection();
366 
367         final DatabaseConfig config = connection.getConfig();
368         expectedDataSetAndVerifyTableDefinitionVerifier.verify(verifyTableDefs,
369                 expectedDataSet, config);
370 
371         try
372         {
373             final int tableDefsCount = verifyTableDefs.length;
374             log.info(
375                     "verifyData: about to verify {} tables"
376                             + " using verifyTableDefinitions={}",
377                     tableDefsCount, verifyTableDefs);
378             if (tableDefsCount == 0)
379             {
380                 log.warn("verifyData: No tables to verify as"
381                         + " no VerifyTableDefinitions specified");
382             }
383 
384             for (int i = 0; i < tableDefsCount; i++)
385             {
386                 final VerifyTableDefinition td = verifyTableDefs[i];
387                 verifyData(connection, td);
388             }
389         } catch (final Exception e)
390         {
391             log.error("verifyData: Exception:", e);
392             throw e;
393         } finally
394         {
395             log.debug("verifyData: Verification done, closing connection");
396             connection.close();
397         }
398     }
399 
400     protected void verifyData(final IDatabaseConnection connection,
401             final VerifyTableDefinition verifyTableDefinition) throws Exception
402     {
403         final String tableName = verifyTableDefinition.getTableName();
404         log.info("verifyData: Verifying table '{}'", tableName);
405 
406         final String[] excludeColumns =
407                 verifyTableDefinition.getColumnExclusionFilters();
408         final String[] includeColumns =
409                 verifyTableDefinition.getColumnInclusionFilters();
410 
411         final ITable expectedTable = loadTableDataFromDataSet(tableName);
412         final ITable actualTable =
413                 loadTableDataFromDatabase(tableName, connection);
414 
415         final Map<String, ValueComparer> columnValueComparers =
416                 findColumnValueComparer(tableName);
417 
418         verifyData(expectedTable, actualTable, excludeColumns, includeColumns,
419                 columnValueComparers);
420     }
421 
422     protected Map<String, ValueComparer> findColumnValueComparer(
423             final String tableName)
424     {
425         final Map<String, ValueComparer> columnValueComparers;
426 
427         if (tableColumnValueComparers == null)
428         {
429             columnValueComparers = null;
430         } else
431         {
432             columnValueComparers = tableColumnValueComparers.get(tableName);
433         }
434 
435         return columnValueComparers;
436     }
437 
438     public ITable loadTableDataFromDataSet(final String tableName)
439             throws DataSetException
440     {
441         ITable table = null;
442 
443         final String methodName = "loadTableDataFromDataSet";
444 
445         log.debug("{}: Loading table {} from expected dataset", methodName,
446                 tableName);
447         try
448         {
449             table = expectedDataSet.getTable(tableName);
450         } catch (final Exception e)
451         {
452             final String msg = methodName + ": Problem obtaining table '"
453                     + tableName + "' from expected dataset";
454             log.error(msg, e);
455             throw new DataSetException(msg, e);
456         }
457         return table;
458     }
459 
460     public ITable loadTableDataFromDatabase(final String tableName,
461             final IDatabaseConnection connection) throws Exception
462     {
463         ITable table = null;
464 
465         final String methodName = "loadTableDataFromDatabase";
466 
467         log.debug("{}: Loading table {} from database", methodName, tableName);
468         try
469         {
470             table = connection.createTable(tableName);
471         } catch (final Exception e)
472         {
473             final String msg = methodName + ": Problem obtaining table '"
474                     + tableName + "' from database";
475             log.error(msg, e);
476             throw new DataSetException(msg, e);
477         }
478         return table;
479     }
480 
481     /**
482      * For the specified expected and actual tables (and excluding and including
483      * the specified columns), verify the actual data is as expected.
484      *
485      * @param expectedTable
486      *            The expected table to compare the actual table to.
487      * @param actualTable
488      *            The actual table to compare to the expected table.
489      * @param excludeColumns
490      *            The column names to exclude from comparison. See
491      *            {@link org.dbunit.dataset.filter.DefaultColumnFilter#excludeColumn(String)}
492      *            .
493      * @param includeColumns
494      *            The column names to only include in comparison. See
495      *            {@link org.dbunit.dataset.filter.DefaultColumnFilter#includeColumn(String)}
496      *            .
497      * @param columnValueComparers
498      *            TODO
499      * @throws DatabaseUnitException
500      */
501     protected void verifyData(final ITable expectedTable,
502             final ITable actualTable, final String[] excludeColumns,
503             final String[] includeColumns,
504             final Map<String, ValueComparer> columnValueComparers)
505             throws DatabaseUnitException
506     {
507         final String methodName = "verifyData";
508         // Filter out the columns from the expected and actual results
509         log.debug("{}: Applying filters to expected table", methodName);
510         final ITable expectedFilteredTable = applyColumnFilters(expectedTable,
511                 excludeColumns, includeColumns);
512         log.debug("{}: Applying filters to actual table", methodName);
513         final ITable actualFilteredTable =
514                 applyColumnFilters(actualTable, excludeColumns, includeColumns);
515 
516         log.debug("{}: Sorting expected table", methodName);
517         final SortedTable expectedSortedTable =
518                 new SortedTable(expectedFilteredTable);
519         log.debug("{}: Sorted expected table={}", methodName,
520                 expectedSortedTable);
521 
522         log.debug("{}: Sorting actual table", methodName);
523         final SortedTable actualSortedTable = new SortedTable(
524                 actualFilteredTable, expectedFilteredTable.getTableMetaData());
525         log.debug("{}: Sorted actual table={}", methodName, actualSortedTable);
526 
527         log.debug("{}: Creating additionalColumnInfo", methodName);
528         final Column[] additionalColumnInfo =
529                 makeAdditionalColumnInfo(expectedTable, excludeColumns);
530         log.debug("{}: additionalColumnInfo={}", methodName,
531                 additionalColumnInfo);
532 
533         log.debug("{}: Comparing expected table to actual table", methodName);
534         compareData(expectedSortedTable, actualSortedTable,
535                 additionalColumnInfo, defaultValueComparer,
536                 columnValueComparers);
537     }
538 
539     /** Compare the tables, enables easy overriding. */
540     protected void compareData(final SortedTable expectedSortedTable,
541             final SortedTable actualSortedTable,
542             final Column[] additionalColumnInfo,
543             final ValueComparer defaultValueComparer,
544             final Map<String, ValueComparer> columnValueComparers)
545             throws DatabaseUnitException
546     {
547         if (defaultValueComparer == null)
548         {
549             // use original until ValueComparer is proven
550             Assertion.assertEquals(expectedSortedTable, actualSortedTable,
551                     additionalColumnInfo);
552         } else
553         {
554             Assertion.assertWithValueComparer(expectedSortedTable,
555                     actualSortedTable, additionalColumnInfo,
556                     defaultValueComparer, columnValueComparers);
557         }
558     }
559 
560     /**
561      * Don't add excluded columns to additionalColumnInfo as they are not found
562      * and generate a not found message in the fail message.
563      */
564     protected Column[] makeAdditionalColumnInfo(final ITable expectedTable,
565             final String[] excludeColumns) throws DataSetException
566     {
567         final List<Column> keepColumnsList = new ArrayList<Column>();
568         final List<String> excludeColumnsList = Arrays.asList(excludeColumns);
569 
570         final Column[] allColumns =
571                 expectedTable.getTableMetaData().getColumns();
572         for (final Column column : allColumns)
573         {
574             final String columnName = column.getColumnName();
575             if (!excludeColumnsList.contains(columnName))
576             {
577                 keepColumnsList.add(column);
578             }
579         }
580 
581         return keepColumnsList.toArray(new Column[keepColumnsList.size()]);
582     }
583 
584     /**
585      * Make a <code>IDataSet</code> from the specified files.
586      *
587      * @param dataFiles
588      *            Represents the array of dbUnit data files.
589      * @return The composite dataset.
590      * @throws DataSetException
591      *             On dbUnit errors.
592      */
593     public IDataSet makeCompositeDataSet(final String[] dataFiles,
594             final String dataFilesName) throws DataSetException
595     {
596         if (dataFileLoader == null)
597         {
598             throw new IllegalStateException(
599                     "dataFileLoader is null; must configure or set it first");
600         }
601 
602         final int count = dataFiles.length;
603         log.debug("makeCompositeDataSet: {} dataFiles count={}", dataFilesName,
604                 count);
605         if (count == 0)
606         {
607             log.info("makeCompositeDataSet: Specified zero {} data files",
608                     dataFilesName);
609         }
610 
611         final List list = new ArrayList();
612         for (int i = 0; i < count; i++)
613         {
614             final IDataSet ds = dataFileLoader.load(dataFiles[i]);
615             list.add(ds);
616         }
617 
618         final IDataSet[] dataSet = (IDataSet[]) list.toArray(new IDataSet[] {});
619         final IDataSet compositeDS = new CompositeDataSet(dataSet);
620         return compositeDS;
621     }
622 
623     /**
624      * Apply the specified exclude and include column filters to the specified
625      * table.
626      *
627      * @param table
628      *            The table to apply the filters to.
629      * @param excludeColumns
630      *            The exclude filters; use null or empty array to mean exclude
631      *            none.
632      * @param includeColumns
633      *            The include filters; use null to mean include all.
634      * @return The filtered table.
635      * @throws DataSetException
636      */
637     public ITable applyColumnFilters(final ITable table,
638             final String[] excludeColumns, final String[] includeColumns)
639             throws DataSetException
640     {
641         ITable filteredTable = table;
642 
643         if (table == null)
644         {
645             throw new IllegalArgumentException("table is null");
646         }
647 
648         // note: dbunit interprets an empty inclusion filter array as one
649         // not wanting to compare anything!
650         if (includeColumns == null)
651         {
652             log.debug("applyColumnFilters: including columns=(all)");
653         } else
654         {
655             log.debug("applyColumnFilters: including columns='{}'",
656                     new Object[] {includeColumns});
657             filteredTable = DefaultColumnFilter
658                     .includedColumnsTable(filteredTable, includeColumns);
659         }
660 
661         if (excludeColumns == null || excludeColumns.length == 0)
662         {
663             log.debug("applyColumnFilters: excluding columns=(none)");
664         } else
665         {
666             log.debug("applyColumnFilters: excluding columns='{}'",
667                     new Object[] {excludeColumns});
668             filteredTable = DefaultColumnFilter
669                     .excludedColumnsTable(filteredTable, excludeColumns);
670         }
671 
672         return filteredTable;
673     }
674 
675     /**
676      * {@inheritDoc}
677      */
678     public IDataSet getPrepDataset()
679     {
680         return prepDataSet;
681     }
682 
683     /**
684      * {@inheritDoc}
685      */
686     public IDataSet getExpectedDataset()
687     {
688         return expectedDataSet;
689     }
690 
691     /**
692      * Get the databaseTester.
693      *
694      * @see {@link #databaseTester}.
695      *
696      * @return The databaseTester.
697      */
698     @Override
699     public IDatabaseTester getDatabaseTester()
700     {
701         return databaseTester;
702     }
703 
704     /**
705      * Set the databaseTester.
706      *
707      * @see {@link #databaseTester}.
708      *
709      * @param databaseTester
710      *            The databaseTester to set.
711      */
712     public void setDatabaseTester(final IDatabaseTester databaseTester)
713     {
714         this.databaseTester = databaseTester;
715     }
716 
717     /**
718      * Get the dataFileLoader.
719      *
720      * @see {@link #dataFileLoader}.
721      *
722      * @return The dataFileLoader.
723      */
724     public DataFileLoader getDataFileLoader()
725     {
726         return dataFileLoader;
727     }
728 
729     /**
730      * Set the dataFileLoader.
731      *
732      * @see {@link #dataFileLoader}.
733      *
734      * @param dataFileLoader
735      *            The dataFileLoader to set.
736      */
737     public void setDataFileLoader(final DataFileLoader dataFileLoader)
738     {
739         this.dataFileLoader = dataFileLoader;
740     }
741 
742     /**
743      * Set the prepDs.
744      *
745      * @see {@link #prepDataSet}.
746      *
747      * @param prepDataSet
748      *            The prepDs to set.
749      */
750     public void setPrepDs(final IDataSet prepDataSet)
751     {
752         this.prepDataSet = prepDataSet;
753     }
754 
755     /**
756      * Set the expectedDs.
757      *
758      * @see {@link #expectedDataSet}.
759      *
760      * @param expectedDataSet
761      *            The expectedDs to set.
762      */
763     public void setExpectedDs(final IDataSet expectedDataSet)
764     {
765         this.expectedDataSet = expectedDataSet;
766     }
767 
768     /**
769      * Get the tableDefs.
770      *
771      * @see {@link #verifyTableDefs}.
772      *
773      * @return The tableDefs.
774      */
775     public VerifyTableDefinition[] getTableDefs()
776     {
777         return verifyTableDefs;
778     }
779 
780     /**
781      * Set the tableDefs.
782      *
783      * @see {@link #verifyTableDefs}.
784      *
785      * @param verifyTableDefs
786      *            The tableDefs to set.
787      */
788     public void setTableDefs(final VerifyTableDefinition[] verifyTableDefs)
789     {
790         this.verifyTableDefs = verifyTableDefs;
791     }
792 
793     public ExpectedDataSetAndVerifyTableDefinitionVerifier getExpectedDataSetAndVerifyTableDefinitionVerifier()
794     {
795         return expectedDataSetAndVerifyTableDefinitionVerifier;
796     }
797 
798     public void setExpectedDataSetAndVerifyTableDefinitionVerifier(
799             final ExpectedDataSetAndVerifyTableDefinitionVerifier expectedDataSetAndVerifyTableDefinitionVerifier)
800     {
801         this.expectedDataSetAndVerifyTableDefinitionVerifier =
802                 expectedDataSetAndVerifyTableDefinitionVerifier;
803     }
804 
805     public ValueComparerAndVerifyTableDefinitionVerifier getValueComparerAndVerifyTableDefinitionVerifier()
806     {
807         return valueComparerAndVerifyTableDefinitionVerifier;
808     }
809 
810     public void setValueComparerAndVerifyTableDefinitionVerifier(
811             final ValueComparerAndVerifyTableDefinitionVerifier valueComparerAndVerifyTableDefinitionVerifier)
812     {
813         this.valueComparerAndVerifyTableDefinitionVerifier =
814                 valueComparerAndVerifyTableDefinitionVerifier;
815     }
816 }