Skip to content

Commit

Permalink
Fixing compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Kenney committed Nov 9, 2017
1 parent 6bc9c38 commit 2b9d945
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package jacle.incubator.exec;

import jacle.common.exec.JavaArgsBuilder;
import jacle.common.io.RuntimeIOException;
import jacle.incubator.exec.ArgsEncoderTest.ArgsProcessExecutor;
import jacle.incubator.exec.ArgsEncoderTest.ValueEncoder;
import jacle.incubator.exec.ProcessLauncher.Result;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand All @@ -18,6 +12,12 @@
import org.junit.Ignore;
import org.junit.Test;

import jacle.common.exec.JavaArgsBuilder;
import jacle.common.io.RuntimeIOException;
import jacle.incubator.exec.ArgsEncoderTest.ArgsProcessExecutor;
import jacle.incubator.exec.ArgsEncoderTest.ValueEncoder;
import jacle.incubator.exec.ProcessLauncher.Result;

/**
* This class simulates the way that Install4j launches child process and
* demonstrates that the existing {@link ArgsEncoder} will not solve the
Expand All @@ -38,7 +38,7 @@ public void setUp() throws Exception {
@Ignore // This doesn't work. It's just included for demonstration purposes.
@Test
public void testEncodeForInstall4j() throws Exception {
encoderTest.ensureWindows();
if (!encoderTest.isWindows()) { return; }

ValueEncoder encoder = new ValueEncoder() { public String encode(String value) {
// This doesn't do the job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public void setUp() throws Exception {
*/
@Test
public void testEncodeWinJavaToJava() throws Exception {
if (!System.getProperty("os.name").startsWith("Windows")) { return; }

if (!isWindows()) { return; }
// Use ArgsEncoder.I.encodeWinJavaToJava(value) to encode arguments
ValueEncoder encoder = new ValueEncoder() { public String encode(String value) {
return ArgsEncoder.I.encodeWinJavaToJava(value);
Expand Down Expand Up @@ -282,4 +282,8 @@ private static String concatN(char c, int n) {
}
return builder.toString();
}

boolean isWindows() {
return System.getProperty("os.name").startsWith("Windows");
}
}

0 comments on commit 2b9d945

Please sign in to comment.