[java] Fixing a CommandLine test
import static java.lang.System.getenv;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.openqa.selenium.Platform.WINDOWS;
import static org.openqa.selenium.os.CommandLine.getLibraryPathPropertyName;
import org.junit.Assume;
@@ -137,7 +138,8 @@ public void canCopyOutput() {
@Test
public void canDetectSuccess() {
- CommandLine commandLine = new CommandLine(testExecutable, "localhost");
+ CommandLine commandLine = new CommandLine(
+ testExecutable, (Platform.getCurrent().is(WINDOWS) ? "-n" : "-c"), "3", "localhost");
commandLine.execute();
assertThat(commandLine.isSuccessful()).isTrue();
assertThat(commandLine.getExitCode()).isEqualTo(0);
@@ -153,7 +155,7 @@ public void canDetectFailure() {
@Test
public void canUpdateLibraryPath() {
- Assume.assumeTrue(Platform.getCurrent().is(Platform.WINDOWS));
+ Assume.assumeTrue(Platform.getCurrent().is(WINDOWS));
CommandLine commandLine = new CommandLine(testExecutable);
commandLine.updateDynamicLibraryPath("C:\\My\\Tools");
assertThat(commandLine.getEnvironment())
