Skip to content

Commit

Permalink
EnabledOnOs
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Dec 3, 2024
1 parent 61016d8 commit 0623b0f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<String> jlinkArgs = mojo.createJlinkArgs(List.of("foo", "bar"), List.of("mvn", "jlink"));
Commandline cmdLine = JLinkExecutor.createJLinkCommandLine(new File("/path/to/jlink"), jlinkArgs);
Expand All @@ -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<String> jlinkArgs = mojo.createJlinkArgs(List.of("foo", "bar"), List.of("mvn", "jlink"));
Commandline cmdLine = JLinkExecutor.createJLinkCommandLine(new File("/path/to/jlink"), jlinkArgs);
Expand Down

0 comments on commit 0623b0f

Please sign in to comment.