Skip to content

Commit

Permalink
Allow security manager in IntelliJ unit tests (#12330)
Browse files Browse the repository at this point in the history
If you configure IntelliJ to use JDK 21 then all unit tests will fail to
run in the IDE when attempting to set the security manager in the test
bootstrap code. This change configures all tests to include the required
VM argument to enable the security manager.

Signed-off-by: Andrew Ross <[email protected]>
(cherry picked from commit f73c82a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Feb 15, 2024
1 parent 4c476fe commit 870f574
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gradle/ide.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ if (System.getProperty('idea.active') == 'true') {
runConfigurations {
defaults(JUnit) {
vmParameters = '-ea -Djava.locale.providers=SPI,COMPAT'
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) {
vmParameters += ' -Djava.security.manager=allow'
}
}
}
copyright {
Expand Down

0 comments on commit 870f574

Please sign in to comment.