CLI: suppress warning on JDK 9+ with illegal access to ResourceBundle

The underlying issue is tracked in IDEA-248785.

 #KT-43704 Fixed
This commit is contained in:
Alexander Udalov
2021-01-07 22:26:43 +01:00
parent 2ef4ca4e6e
commit f08733eb75
3 changed files with 33 additions and 7 deletions
@@ -33,7 +33,8 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
expectedStdout: String = "",
expectedStderr: String = "",
expectedExitCode: Int = 0,
workDirectory: File? = null
workDirectory: File? = null,
environment: Map<String, String> = emptyMap(),
) {
val executableFileName = if (SystemInfo.isWindows) "$executableName.bat" else executableName
val launcherFile = File(PathUtil.kotlinPathsForDistDirectory.homePath, "bin/$executableFileName")
@@ -43,9 +44,10 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
// So, use ProcessBuilder instead.
val pb = ProcessBuilder(
launcherFile.absolutePath,
// In cmd, `=` is delimeter, so we need to surround parameter with quotes.
// In cmd, `=` is delimiter, so we need to surround parameter with quotes.
*quoteIfNeeded(args)
)
pb.environment().putAll(environment)
pb.directory(workDirectory)
val process = pb.start()
val stdout =
@@ -334,4 +336,17 @@ fun f() : Result<Int> = Result.success(42)
)
runProcess("kotlin", "-howtorun", "classfile", "test.HelloWorldKt", expectedStdout = "Hello!\n", workDirectory = tmpdir)
}
fun testKotlincJdk15() {
val jdk15 = mapOf("JAVA_HOME" to KtTestUtil.getJdk15Home().absolutePath)
runProcess(
"kotlinc", "$testDataDirectory/helloWorld.kt", "-d", tmpdir.path,
environment = jdk15,
)
runProcess(
"kotlin", "-e", "listOf('O'.toString() + 'K')",
expectedStdout = "[OK]\n", environment = jdk15,
)
}
}