aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-05-19 16:14:21 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-05-19 16:14:21 +0200
commitff3117718a1642e99d97416b88b2db702d1b96f8 (patch)
treeaa3afbd405482ee72453b9dca17266b5465d8e66 /sonar-testing-harness
parent1dfe5d781675f0a7dfe19dce93757a47262abbae (diff)
downloadsonarqube-ff3117718a1642e99d97416b88b2db702d1b96f8.tar.gz
sonarqube-ff3117718a1642e99d97416b88b2db702d1b96f8.zip
Fix merge of release 2.8
Diffstat (limited to 'sonar-testing-harness')
-rw-r--r--sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java14
-rw-r--r--sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl1
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)