Skip to content

Commit

Permalink
Mysql docker test uses wrong driver (mariadb instead of mysql).
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapac committed Jun 4, 2019
1 parent dfa0d83 commit b386498
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions exposed/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ repositories {
jcenter()
}

val dialect: String by project

dependencies {
api(kotlin("stdlib"))
api(kotlin("reflect"))
Expand All @@ -24,16 +26,22 @@ dependencies {
testImplementation("log4j", "log4j", "1.2.17")
testImplementation("junit", "junit", "4.12")
testImplementation("org.hamcrest", "hamcrest-library", "1.3")
testImplementation("com.h2database", "h2", "1.4.199")

testImplementation("mysql", "mysql-connector-java", "5.1.47")
testImplementation("mysql", "mysql-connector-mxj", "5.0.12")
testImplementation("org.mariadb.jdbc", "mariadb-java-client", "2.4.1")
testImplementation("org.postgresql", "postgresql", "42.2.5.jre6")
testImplementation("com.opentable.components", "otj-pg-embedded", "0.12.0")
testImplementation("mysql", "mysql-connector-mxj", "5.0.12")
testImplementation("org.xerial", "sqlite-jdbc", "3.23.1")
testImplementation("com.oracle", "ojdbc6", "12.1.0.1-atlassian-hosted")
testImplementation("com.microsoft.sqlserver", "mssql-jdbc", "7.2.2.jre8")

when (dialect) {
"mariadb" -> testImplementation("org.mariadb.jdbc", "mariadb-java-client", "2.4.1")
"mysql" -> testImplementation("mysql", "mysql-connector-java", "8.0.16")
"oracle" -> testImplementation("com.oracle", "ojdbc6", "12.1.0.1-atlassian-hosted")
"sqlserver" -> testImplementation("com.microsoft.sqlserver", "mssql-jdbc", "7.2.2.jre8")
else -> {
testImplementation("com.h2database", "h2", "1.4.199")
testImplementation("mysql", "mysql-connector-java", "5.1.47")
testImplementation("org.postgresql", "postgresql", "42.2.5.jre6")
}
}
}

publishJar {
Expand Down Expand Up @@ -63,5 +71,4 @@ tasks.withType(Test::class.java) {
}
}

val dialect: String by project
setupDialectTest(dialect)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ enum class TestDB(val connection: () -> String, val driver: String, val user: St
SQLITE({"jdbc:sqlite:file:test?mode=memory&cache=shared"}, "org.sqlite.JDBC"),
MYSQL({
System.getProperty("exposed.test.mysql.host")?.let { dockerHost ->
"jdbc:mysql://$dockerHost:${System.getProperty("exposed.test.mysql.port")!!}/testdb"
"jdbc:mysql://$dockerHost:${System.getProperty("exposed.test.mysql.port")!!}/testdb?useSSL=false"
} ?: "jdbc:mysql:mxj://localhost:12345/testdb1?createDatabaseIfNotExist=true&server.initialize-user=false&user=root&password="
},
driver = "com.mysql.jdbc.Driver",
Expand Down

0 comments on commit b386498

Please sign in to comment.