diff options
Diffstat (limited to 'sonar-testing-harness')
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java | 14 | ||||
-rw-r--r-- | sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java b/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java index ba9e47b6e76..7c8d4543d6c 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java @@ -196,6 +196,20 @@ public abstract class DatabaseTestCase { } } + protected final void assertTables(String testName, String[] tables, String[] ignoreCols) { + try { + IDataSet dataSet = getCurrentDataSet(); + IDataSet expectedDataSet = getExpectedData(testName); + for (String table : tables) { + Assertion.assertEqualsIgnoreCols(expectedDataSet.getTable(table), dataSet.getTable(table), ignoreCols); + } + } catch (DataSetException e) { + throw translateException("Error while checking results", e); + } catch (DatabaseUnitException e) { + fail(e.getMessage()); + } + } + protected final void assertEmptyTables(String... emptyTables) { for (String table : emptyTables) { try { diff --git a/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl b/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl index c5125179cbf..54f49a0953b 100644 --- a/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl +++ b/sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl @@ -492,6 +492,7 @@ CREATE TABLE REVIEWS ( STATUS VARCHAR(10), SEVERITY VARCHAR(10), RULE_FAILURE_PERMANENT_ID INTEGER, + PROJECT_ID INTEGER, RESOURCE_ID INTEGER, RESOURCE_LINE INTEGER, primary key (id) |