From 6fc8aaeac828ecb18afa7c2f750b802b038c938b Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 1 Mar 2016 09:29:09 +0100 Subject: [PATCH] Fix DB tests on non-H2 --- sonar-db/src/test/java/org/sonar/db/DbTester.java | 3 ++- .../version/v52/RemoveAnalysisReportsFromActivitiesTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sonar-db/src/test/java/org/sonar/db/DbTester.java b/sonar-db/src/test/java/org/sonar/db/DbTester.java index 55ca750d3dc..9936840875c 100644 --- a/sonar-db/src/test/java/org/sonar/db/DbTester.java +++ b/sonar-db/src/test/java/org/sonar/db/DbTester.java @@ -29,6 +29,7 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.List; +import java.util.Locale; import java.util.Map; import javax.annotation.CheckForNull; import javax.annotation.Nullable; @@ -144,7 +145,7 @@ public class DbTester extends ExternalResource { */ public int countRowsOfTable(String tableName) { Preconditions.checkArgument(StringUtils.containsNone(tableName, " "), "Parameter must be the name of a table. Got " + tableName); - return countSql("select count(1) from " + tableName); + return countSql("select count(1) from " + tableName.toLowerCase(Locale.ENGLISH)); } /** diff --git a/sonar-db/src/test/java/org/sonar/db/version/v52/RemoveAnalysisReportsFromActivitiesTest.java b/sonar-db/src/test/java/org/sonar/db/version/v52/RemoveAnalysisReportsFromActivitiesTest.java index 531d51a4cde..85a415da6b8 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/v52/RemoveAnalysisReportsFromActivitiesTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/v52/RemoveAnalysisReportsFromActivitiesTest.java @@ -42,6 +42,6 @@ public class RemoveAnalysisReportsFromActivitiesTest { underTest.execute(); - assertThat(db.countRowsOfTable("ACTIVITIES")).isEqualTo(1); + assertThat(db.countRowsOfTable("activities")).isEqualTo(1); } } -- 2.39.5