takimafr / spring-dbunit

DBUnit support for Spring
Apache License 2.0
40 stars 19 forks source link

Bug in DataSetTestExecutionListener at line 86 (Version 1.4.0) #52

Open jtchatchoua opened 8 years ago

jtchatchoua commented 8 years ago

private void checkDatas(TestContext testContext) throws Exception { ExpectedDataSetConfiguration expectedConfiguration = getExpectedConfiguration(testContext); if (expectedConfiguration != null) { IDataSet expectedDataSet = expectedConfiguration.getDataSet(); for (String tableName : expectedDataSet.getTableNames()) { IDataSet dataSet = dataReader.execute(testContext.getApplicationContext(), getExpectedConfiguration(testContext), tableName); String[] columnsToIgnore = expectedConfiguration.getColumnsToIgnore(); if (columnsToIgnore == null || columnsToIgnore.length == 0) {

              `Assertion.assertEquals(expectedDataSet, dataSet);`

// When the dataset has more than one table, test fails when compare tableNames length. I think the code here should be
Assertion.assertEquals(expectedDataSet.getTable(tableName), dataSet.getTable(tableName));

            } else {
                Assertion.assertEqualsIgnoreCols(expectedDataSet, dataSet, tableName, columnsToIgnore);
            }
        }
    }