aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-04-26 10:39:13 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-04-26 12:28:43 +0200
commit02916fd6e0ed5c4cd18361a47ecf86cc5f09c573 (patch)
tree3635be0c36bb1df424f25abbfff1f8b1bd22414b /sonar-db
parentaa9ee793babd0b89d89a7ccacd4064932cdc4740 (diff)
downloadsonarqube-02916fd6e0ed5c4cd18361a47ecf86cc5f09c573.tar.gz
sonarqube-02916fd6e0ed5c4cd18361a47ecf86cc5f09c573.zip
SONAR-7549 disable SqlExecutorTest on non-H2 dbs
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/charset/SqlExecutorTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/charset/SqlExecutorTest.java b/sonar-db/src/test/java/org/sonar/db/charset/SqlExecutorTest.java
index 0ca4dc561c2..4c806bebc29 100644
--- a/sonar-db/src/test/java/org/sonar/db/charset/SqlExecutorTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/charset/SqlExecutorTest.java
@@ -23,12 +23,15 @@ import com.google.common.collect.ImmutableMap;
import java.sql.Connection;
import java.util.List;
import java.util.Map;
+import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
+import org.sonar.db.dialect.H2;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assume.assumeTrue;
public class SqlExecutorTest {
@@ -41,6 +44,14 @@ public class SqlExecutorTest {
@Rule
public DbTester dbTester = DbTester.create(System2.INSTANCE);
+ @Before
+ public void disableIfNotH2() {
+ // TODO dbTester.selectFirst() returns keys with different case
+ // depending on target db (lower-case for MySQL but upper-case for H2).
+ // It has to be fixed in order to reactive this test for all dbs.
+ assumeTrue(dbTester.database().getDialect().getId().equals(H2.ID));
+ }
+
@Test
public void executeSelect_executes_PreparedStatement() throws Exception {
dbTester.executeInsert(USERS_DB_TABLE, ImmutableMap.of(LOGIN_DB_COLUMN, "login1", NAME_DB_COLUMN, "name one"));