From: Simon Brandhof Date: Tue, 26 Apr 2016 08:39:13 +0000 (+0200) Subject: SONAR-7549 disable SqlExecutorTest on non-H2 dbs X-Git-Tag: 5.5-RC2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b703dfe0819ba127755d3842066ec09ea72358f8;p=sonarqube.git SONAR-7549 disable SqlExecutorTest on non-H2 dbs --- 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"));