Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ayato-p committed Nov 13, 2024
1 parent 9f95504 commit ef04d28
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions examples/database/src/test/kotlin/Sample.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import com.thoughtworks.gauge.AfterSuite
import com.thoughtworks.gauge.BeforeSuite
import com.thoughtworks.gauge.Step
import com.uzabase.playtest2.core.config.Configuration
import com.uzabase.playtest2.jdbc.config.jdbc
import org.testcontainers.containers.PostgreSQLContainer
import java.sql.DriverManager
import java.util.logging.Level
import java.util.logging.LogManager

class Sample {
val container = PostgreSQLContainer<Nothing>("postgres:17.0-bookworm").apply {
private val container = PostgreSQLContainer<Nothing>("postgres:17.0-bookworm").apply {
withDatabaseName("testdatabase")
withUsername("michel")
withPassword("goodpassphrase")
Expand All @@ -32,14 +30,4 @@ class Sample {
fun afterSuite() {
container.stop()
}

@Step("Hello world")
fun sampleStep() {
DriverManager.getConnection(container.jdbcUrl, container.username, container.password).use { conn ->
val rs = conn.prepareStatement("select id, name from users").executeQuery()
while (rs.next()) {
println("${rs.getInt(1)}: ${rs.getString(2)}")
}
}
}
}

0 comments on commit ef04d28

Please sign in to comment.