Skip to content

Commit

Permalink
Allow security manager in IntelliJ unit tests (#12330) (#12335)
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.


(cherry picked from commit f73c82a)

Signed-off-by: Andrew Ross <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent cafc515 commit ae7cb0c
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 ae7cb0c

Please sign in to comment.