File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
ktorm-support-oracle/src/test/kotlin/org/ktorm/support/oracle Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change 11package org.ktorm.support.oracle
22
3+ import org.junit.ClassRule
34import org.ktorm.BaseTest
45import org.ktorm.database.Database
56import org.testcontainers.containers.OracleContainer
6- import kotlin.concurrent.thread
77
88abstract class BaseOracleTest : BaseTest () {
99
@@ -32,17 +32,20 @@ abstract class BaseOracleTest : BaseTest() {
3232 *
3333 * See https://java.testcontainers.org/supported_docker_environment/#colima
3434 */
35- companion object : OracleContainer (" gvenzl/oracle-xe:11.2.0.2" ) {
36- init {
37- // Configure the container.
38- usingSid()
39- withReuse(true )
40- withCreateContainerCmdModifier { cmd -> cmd.hostConfig?.withShmSize((1 * 1024 * 1024 * 1024 ).toLong()) }
41-
42- // Start the container when it's first used.
43- start()
44- // Stop the container when the process exits.
45- Runtime .getRuntime().addShutdownHook(thread(start = false ) { stop() })
46- }
35+ companion object {
36+ @JvmField
37+ @ClassRule
38+ val container: OracleContainer
39+ = OracleContainer (" gvenzl/oracle-xe:11.2.0.2" )
40+ .usingSid()
41+ .withCreateContainerCmdModifier { cmd -> cmd.hostConfig?.withShmSize((1 * 1024 * 1024 * 1024 ).toLong()) }
42+
43+ val jdbcUrl: String get() = container.jdbcUrl
44+
45+ val driverClassName: String get() = container.driverClassName
46+
47+ val username: String get() = container.username
48+
49+ val password: String get() = container.password
4750 }
4851}
You can’t perform that action at this time.
0 commit comments