mirror of
https://github.com/jlengrand/Exposed.git
synced 2026-03-10 08:11:20 +00:00
Oracle docker tests reanimated
This commit is contained in:
@@ -3,16 +3,11 @@ version: '3.1'
|
||||
services:
|
||||
oracle:
|
||||
container_name: oracleDB
|
||||
image: sath89/oracle-12c:latest
|
||||
image: quillbuilduser/oracle-18-xe:latest
|
||||
ports:
|
||||
- "1521"
|
||||
environment:
|
||||
WEB_CONSOLE: "true"
|
||||
DBCA_TOTAL_MEMORY: 1024
|
||||
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/app/oracle/product/12.1.0/xe/bin
|
||||
USE_UTF8_IF_CHARSET_EMPTY: "true"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/apex"]
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
USE_UTF8_IF_CHARSET_EMPTY: "true"
|
||||
@@ -55,7 +55,7 @@ class Database private constructor(val connector: () -> Connection) {
|
||||
IdentifierManager(metadata)
|
||||
}
|
||||
|
||||
internal class IdentifierManager(private val metadata: DatabaseMetaData) {
|
||||
internal class IdentifierManager(metadata: DatabaseMetaData) {
|
||||
internal val quoteString = metadata.identifierQuoteString!!.trim()
|
||||
private val isUpperCaseIdentifiers = metadata.storesUpperCaseIdentifiers()
|
||||
private val isUpperCaseQuotedIdentifiers = metadata.storesUpperCaseQuotedIdentifiers()
|
||||
@@ -67,7 +67,12 @@ class Database private constructor(val connector: () -> Connection) {
|
||||
private val supportsQuotedMixedId = metadata.supportsMixedCaseQuotedIdentifiers()
|
||||
val keywords = ANSI_SQL_2003_KEYWORDS + VENDORS_KEYWORDS[currentDialect.name].orEmpty() + metadata.sqlKeywords.split(',')
|
||||
private val extraNameCharacters = metadata.extraNameCharacters!!
|
||||
private val identifierLengthLimit = metadata.maxColumnNameLength.takeIf { it > 0 } ?: Int.MAX_VALUE
|
||||
private val identifierLengthLimit = run {
|
||||
if (metadata.databaseProductName == "Oracle")
|
||||
128
|
||||
else
|
||||
metadata.maxColumnNameLength.takeIf { it > 0 } ?: Int.MAX_VALUE
|
||||
}
|
||||
|
||||
val checkedIdentities = object : LinkedHashMap<String, Boolean> (100) {
|
||||
override fun removeEldestEntry(eldest: MutableMap.MutableEntry<String, Boolean>?): Boolean = size >= 1000
|
||||
|
||||
@@ -39,22 +39,21 @@ enum class TestDB(val connection: () -> String, val driver: String, val user: St
|
||||
}),
|
||||
POSTGRESQL({"jdbc:postgresql://localhost:12346/template1?user=postgres&password=&lc_messages=en_US.UTF-8"}, "org.postgresql.Driver",
|
||||
beforeConnection = { postgresSQLProcess }, afterTestFinished = { postgresSQLProcess.close() }),
|
||||
ORACLE(driver = "oracle.jdbc.OracleDriver", user = "ExposedTest", pass = "12345",
|
||||
ORACLE(driver = "oracle.jdbc.OracleDriver", user = "C##ExposedTest", pass = "12345",
|
||||
connection = {"jdbc:oracle:thin:@//${System.getProperty("exposed.test.oracle.host", "localhost")}" +
|
||||
":${System.getProperty("exposed.test.oracle.port", "1521")}/xe"},
|
||||
beforeConnection = {
|
||||
Locale.setDefault(Locale.ENGLISH)
|
||||
val tmp = Database.connect(ORACLE.connection(), user = "sys as sysdba", password = "oracle", driver = ORACLE.driver)
|
||||
val tmp = Database.connect(ORACLE.connection(), user = "sys as sysdba", password = "Oracle18", driver = ORACLE.driver)
|
||||
transaction(java.sql.Connection.TRANSACTION_READ_COMMITTED, 1, tmp) {
|
||||
try {
|
||||
exec("DROP USER ExposedTest CASCADE")
|
||||
exec("DROP USER C##ExposedTest CASCADE")
|
||||
} catch (e: Exception) { // ignore
|
||||
exposedLogger.warn("Exception on deleting ExposedTest user", e)
|
||||
exposedLogger.warn("Exception on deleting C##ExposedTest user", e)
|
||||
}
|
||||
|
||||
exec("CREATE USER ExposedTest IDENTIFIED BY 12345 DEFAULT TABLESPACE system QUOTA UNLIMITED ON system")
|
||||
exec("grant all privileges to ExposedTest IDENTIFIED BY 12345")
|
||||
exec("grant dba to ExposedTest IDENTIFIED BY 12345")
|
||||
exec("CREATE USER C##ExposedTest IDENTIFIED BY 12345 DEFAULT TABLESPACE system QUOTA UNLIMITED ON system")
|
||||
exec("grant all privileges to C##ExposedTest")
|
||||
exec("grant dba to C##ExposedTest")
|
||||
}
|
||||
Unit
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user