/** * For the specified expected and actual tables (and excluding and including the specified * columns), verify the actual data is as expected. * * @param expectedTable The expected table to compare the actual table to. * @param actualTable The actual table to compare to the expected table. * @param excludeColumns The column names to exclude from comparison. See {@link * org.dbunit.dataset.filter.DefaultColumnFilter#excludeColumn(String)} . * @param includeColumns The column names to only include in comparison. See {@link * org.dbunit.dataset.filter.DefaultColumnFilter#includeColumn(String)} . * @throws DatabaseUnitException */ public void verifyData( ITable expectedTable, ITable actualTable, String[] excludeColumns, String[] includeColumns) throws DatabaseUnitException { final String method = "verifyData: "; // Filter out the columns from the expected and actual results LOG.debug(method + "Applying filters to expected table"); ITable expectedFilteredTable = applyColumnFilters(expectedTable, excludeColumns, includeColumns); LOG.debug(method + "Applying filters to actual table"); ITable actualFilteredTable = applyColumnFilters(actualTable, excludeColumns, includeColumns); LOG.debug(method + "Sorting expected table"); SortedTable expectedSortedTable = new SortedTable(expectedFilteredTable); LOG.debug(method + "Sorted expected table={}", expectedSortedTable); LOG.debug(method + "Sorting actual table"); SortedTable actualSortedTable = new SortedTable(actualFilteredTable, expectedFilteredTable.getTableMetaData()); LOG.debug(method + "Sorted actual table={}", actualSortedTable); LOG.debug(method + "Comparing expected table to actual table"); Column[] additionalColumnInfo = expectedTable.getTableMetaData().getColumns(); Assertion.assertEquals(expectedSortedTable, actualSortedTable, additionalColumnInfo); }