mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[testFramework] Sanity check for --add-opens options to crash more friendly if Plugin DevKit is disabled
GitOrigin-RevId: e03360742bdb9a322e7f26bbd105930a4d774ff6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b934cfe38a
commit
671bfcf894
@@ -10,6 +10,7 @@ import com.intellij.testFramework.TestLoggerFactory
|
||||
import com.intellij.util.Java11Shim
|
||||
import org.jetbrains.annotations.ApiStatus.Internal
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import java.lang.management.ManagementFactory
|
||||
|
||||
@TestOnly
|
||||
@Internal
|
||||
@@ -26,6 +27,7 @@ fun initializeTestEnvironment() {
|
||||
if (isTestEnvironmentInitialized) {
|
||||
return
|
||||
}
|
||||
checkAddOpens()
|
||||
IdeaForkJoinWorkerThreadFactory.setupForkJoinCommonPool(true) // from UsefulTestCase
|
||||
Logger.setFactory(TestLoggerFactory::class.java) // from UsefulTestCase
|
||||
// Radar #5755208: Command line Java applications need a way to launch without a Dock icon.
|
||||
@@ -36,3 +38,10 @@ fun initializeTestEnvironment() {
|
||||
PlatformPrefix.autodetectPlatformPrefix() // from TestApplicationManager
|
||||
isTestEnvironmentInitialized = true
|
||||
}
|
||||
|
||||
fun checkAddOpens() {
|
||||
val jvmArguments = ManagementFactory.getRuntimeMXBean().inputArguments;
|
||||
if ("--add-opens=java.base/java.lang=ALL-UNNAMED" !in jvmArguments) {
|
||||
throw AssertionError("Required --add-opens options are missing in command line. Make sure that Plugin DevKit is installed and enabled.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user