]> source.dussan.org Git - sonarqube.git/commitdiff
Fix DB tests on non-H2
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 1 Mar 2016 08:29:09 +0000 (09:29 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 1 Mar 2016 08:29:09 +0000 (09:29 +0100)
sonar-db/src/test/java/org/sonar/db/DbTester.java
sonar-db/src/test/java/org/sonar/db/version/v52/RemoveAnalysisReportsFromActivitiesTest.java

index 55ca750d3dc5198cb8ffb338d48d73e244f8feae..9936840875cee99ff101dc1831173c2c02236463 100644 (file)
@@ -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));
   }
 
   /**
index 531d51a4cde32658899c2369b265b9b530346b41..85a415da6b8c587268247f1527bcc6b19e59b8df 100644 (file)
@@ -42,6 +42,6 @@ public class RemoveAnalysisReportsFromActivitiesTest {
 
     underTest.execute();
 
-    assertThat(db.countRowsOfTable("ACTIVITIES")).isEqualTo(1);
+    assertThat(db.countRowsOfTable("activities")).isEqualTo(1);
   }
 }