From 0623b0f742ebd427c6c2f29c802e796111e768b6 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Tue, 3 Dec 2024 11:41:07 -0500 Subject: [PATCH] EnabledOnOs --- .../org/apache/maven/plugins/jlink/JLinkMojoTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/jlink/JLinkMojoTest.java b/src/test/java/org/apache/maven/plugins/jlink/JLinkMojoTest.java index fdc480e..cadfd74 100644 --- a/src/test/java/org/apache/maven/plugins/jlink/JLinkMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/jlink/JLinkMojoTest.java @@ -26,6 +26,9 @@ import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; import static org.assertj.core.api.Assertions.assertThat; @@ -50,10 +53,9 @@ void double_quote_every_argument() throws Exception { assertThat(jlinkArgs).noneMatch(arg -> arg.trim().isBlank()); } + @DisabledOnOs(OS.WINDOWS) @Test void single_quotes_shell_command_unix() throws Exception { - Assumptions.assumeFalse(System.getProperty("os.name").startsWith("Windows")); - // when List jlinkArgs = mojo.createJlinkArgs(List.of("foo", "bar"), List.of("mvn", "jlink")); Commandline cmdLine = JLinkExecutor.createJLinkCommandLine(new File("/path/to/jlink"), jlinkArgs); @@ -64,10 +66,9 @@ void single_quotes_shell_command_unix() throws Exception { "/bin/sh -c '/path/to/jlink \"--strip-debug\" \"--module-path\" \"foo:bar\" \"--add-modules\" \"mvn,jlink\"'"); } + @EnabledOnOs(OS.WINDOWS) @Test void single_quotes_shell_command_windows() throws Exception { - Assumptions.assumeTrue(System.getProperty("os.name").startsWith("Windows")); - // when List jlinkArgs = mojo.createJlinkArgs(List.of("foo", "bar"), List.of("mvn", "jlink")); Commandline cmdLine = JLinkExecutor.createJLinkCommandLine(new File("/path/to/jlink"), jlinkArgs);