diff --git a/picocli-tests-java8plus/src/test/java/picocli/AutoCompleteSystemExitTest.java b/picocli-tests-java8plus/src/test/java/picocli/AutoCompleteSystemExitTest.java index ac52baba8..1c8e612b5 100644 --- a/picocli-tests-java8plus/src/test/java/picocli/AutoCompleteSystemExitTest.java +++ b/picocli-tests-java8plus/src/test/java/picocli/AutoCompleteSystemExitTest.java @@ -2,6 +2,8 @@ import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import java.io.File; import java.io.FileInputStream; @@ -507,6 +509,7 @@ private String expectedCompletionScriptForNonDefault() { } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppHelp() throws Exception { String[][] argsList = new String[][] { {"-h"}, @@ -544,6 +547,7 @@ public void testAutoCompleteAppHelp_NoSystemExit() throws Exception { } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteRequiresCommandLineFQCN() throws Exception { int statusCode = catchSystemExit(() -> { restoreSystemProperties(() -> { @@ -568,6 +572,7 @@ public void testAutoCompleteRequiresCommandLineFQCN_NoSystemExit() throws Except } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppCannotInstantiate() throws Exception { @CommandLine.Command(name = "test") class TestApp { @@ -602,6 +607,7 @@ class TestApp { } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppCompletionScriptFileWillNotOverwrite() throws Exception { File dir = new File(System.getProperty("java.io.tmpdir")); final File completionScript = new File(dir, "App_completion"); @@ -650,6 +656,7 @@ public void testAutoCompleteAppCompletionScriptFileWillNotOverwrite_NoSystemExit } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppCommandScriptFileWillNotOverwrite() throws Exception { File dir = new File(System.getProperty("java.io.tmpdir")); final File commandScript = new File(dir, "picocli.AutoComplete"); @@ -702,6 +709,7 @@ public void testAutoCompleteAppCommandScriptFileWillNotOverwrite_NoSystemExit() } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppCommandScriptFileWillOverwriteIfRequested() throws Exception { File dir = new File(System.getProperty("java.io.tmpdir")); final File commandScript = new File(dir, "picocli.AutoComplete"); @@ -731,6 +739,7 @@ public void testAutoCompleteAppCommandScriptFileWillOverwriteIfRequested() throw } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppBothScriptFilesForceOverwrite() throws Exception { File dir = new File(System.getProperty("java.io.tmpdir")); final File commandScript = new File(dir, "picocli.AutoComplete"); @@ -816,6 +825,7 @@ public void testAutoCompleteAppBothScriptFilesForceOverwrite_NoSystemExit() thro } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppGeneratesScriptNameBasedOnCommandName() throws Exception { final String commandName = "bestCommandEver"; @@ -871,6 +881,7 @@ public K create(Class cls) { } @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void testAutoCompleteAppUsesCustomFactory() throws Exception { final String commandName = "nondefault"; @@ -902,6 +913,7 @@ public void testAutoCompleteAppUsesCustomFactory() throws Exception { private static class PrivateCommandClass { } //Support generating autocompletion scripts for non-public @Command classes #306 @Test + @DisabledForJreRange(min = JRE.JAVA_18, max = JRE.JAVA_21, disabledReason = "UnsupportedOperationException in SystemLambda.withSecurityManager") public void test306_SupportGeneratingAutocompletionScriptForNonPublicCommandClasses() throws Exception { File dir = new File(System.getProperty("java.io.tmpdir")); final File completionScript = new File(dir, "App_completion");