Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.exit tests on Java 18 #1503

Closed
remkop opened this issue Dec 6, 2021 · 0 comments
Closed

System.exit tests on Java 18 #1503

remkop opened this issue Dec 6, 2021 · 0 comments
Labels
theme: build An issue or change related to the build system theme: compatibility Issues related to binary and source backwards compatibility
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Dec 6, 2021

Many exit-code related picocli tests fail when running on Java 18:

picocli.AutoCompleteTest > testBashRejectsNullScript FAILED
    java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
        at java.base/java.lang.System.setSecurityManager(System.java:416)
        at org.junit.contrib.java.lang.system.ProvideSecurityManager.before(ProvideSecurityManager.java:39)
        at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
        at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
        at org.junit.contrib.java.lang.system.internal.LogPrintStream$1$1.evaluate(LogPrintStream.java:30)
        at org.junit.contrib.java.lang.system.internal.PrintStreamHandler$3.evaluate(PrintStreamHandler.java:48)
        at org.junit.contrib.java.lang.system.internal.LogPrintStream$1.evaluate(LogPrintStream.java:26)
        at org.junit.contrib.java.lang.system.internal.LogPrintStream$1$1.evaluate(LogPrintStream.java:30)
        at org.junit.contrib.java.lang.system.internal.PrintStreamHandler$3.evaluate(PrintStreamHandler.java:48)
        at org.junit.contrib.java.lang.system.internal.LogPrintStream$1.evaluate(LogPrintStream.java:26)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        ...
  • picocli.AutoCompleteTest
  • picocli.ExecuteLegacyTest

One issue is that migrated tests cannot be run on Java 5, making it harder to verify that the functionality still works as expected on Java 5. So perhaps only the exit-code tests should be migrated.

Note that the issue can be postponed by setting -Djava.security.manager=allow before running the tests.

@remkop remkop added theme: compatibility Issues related to binary and source backwards compatibility theme: build An issue or change related to the build system labels Dec 6, 2021
@remkop remkop added this to the 4.6.3 milestone Dec 6, 2021
remkop added a commit that referenced this issue Dec 7, 2021
@remkop remkop changed the title Migrate exit-code tests to JUnit 5 System.exit tests on Java 18 Dec 7, 2021
@remkop remkop closed this as completed in e669267 Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: build An issue or change related to the build system theme: compatibility Issues related to binary and source backwards compatibility
Projects
None yet
Development

No branches or pull requests

1 participant