Use platform class loader in 'kotlin' runner on JDK 9+
#KT-46312 Fixed
This commit is contained in:
@@ -444,4 +444,31 @@ println(42)
|
||||
workDirectory = subDir
|
||||
)
|
||||
}
|
||||
|
||||
fun testKotlinUseJdkModuleFromMainClass() {
|
||||
val jdk11 = mapOf("JAVA_HOME" to KtTestUtil.getJdk11Home().absolutePath)
|
||||
runProcess(
|
||||
"kotlinc", "$testDataDirectory/jdkModuleUsage.kt", "-d", tmpdir.path,
|
||||
environment = jdk11,
|
||||
)
|
||||
runProcess(
|
||||
"kotlin", "-cp", tmpdir.path, "test.JdkModuleUsageKt",
|
||||
expectedStdout = "interface java.sql.Driver\n",
|
||||
environment = jdk11,
|
||||
)
|
||||
}
|
||||
|
||||
fun testKotlinUseJdkModuleFromJar() {
|
||||
val jdk11 = mapOf("JAVA_HOME" to KtTestUtil.getJdk11Home().absolutePath)
|
||||
val output = tmpdir.resolve("out.jar")
|
||||
runProcess(
|
||||
"kotlinc", "$testDataDirectory/jdkModuleUsage.kt", "-d", output.path,
|
||||
environment = jdk11,
|
||||
)
|
||||
runProcess(
|
||||
"kotlin", output.path,
|
||||
expectedStdout = "interface java.sql.Driver\n",
|
||||
environment = jdk11,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user