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 <andrross@amazon.com>
  • Loading branch information
andrross authored Feb 15, 2024
1 parent bb0b4b0 commit f73c82a
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 f73c82a

Please sign in to comment.