@Test public void starts_an_executable_JAR() { Path executableJar = Paths.get("executable.jar"); List<String> command = newBuilder() .setExecutableJar(executableJar) .freeze() .toCommand(); assertThat(command, containsSubSequence("-jar", executableJar.toAbsolutePath().toString())); }
public List<String> toCommand() { List<String> command = new ArrayList<>(); command.add(javaHome.resolve("bin/java").toAbsolutePath().toString()); command.addAll(jvmOptions); command.addAll(asJvmOptions(systemProperties)); command.add("-jar"); command.add(executableJar.toAbsolutePath().toString()); command.addAll(programArgs); return command; }
JvmArgs { public List<String> toCommand() { List<String> command = new ArrayList<>(); command.add(javaHome.resolve("bin/java").toAbsolutePath().toString()); command.addAll(jvmOptions); command.addAll(asJvmOptions(systemProperties)); command.add("-jar"); command.add(executableJar.toAbsolutePath().toString()); command.addAll(programArgs); return command; } }
JvmArgs { public List<String> toCommand() { List<String> command = new ArrayList<>(); command.add(javaHome.resolve("bin/java").toAbsolutePath().toString()); command.addAll(jvmOptions); command.addAll(asJvmOptions(systemProperties)); command.add("-jar"); command.add(executableJar.toAbsolutePath().toString()); command.addAll(programArgs); return command; } JvmArgs(JvmArgsBuilder src); }
JvmArgs { public List<String> toCommand() { List<String> command = new ArrayList<>(); command.add(javaHome.resolve("bin/java").toAbsolutePath().toString()); command.addAll(jvmOptions); command.addAll(asJvmOptions(systemProperties)); command.add("-jar"); command.add(executableJar.toAbsolutePath().toString()); command.addAll(programArgs); return command; } JvmArgs(JvmArgsBuilder src); Path getWorkingDir(); List<String> toCommand(); }
JvmArgs { public List<String> toCommand() { List<String> command = new ArrayList<>(); command.add(javaHome.resolve("bin/java").toAbsolutePath().toString()); command.addAll(jvmOptions); command.addAll(asJvmOptions(systemProperties)); command.add("-jar"); command.add(executableJar.toAbsolutePath().toString()); command.addAll(programArgs); return command; } JvmArgs(JvmArgsBuilder src); Path getWorkingDir(); List<String> toCommand(); final Path workingDir; final Path javaHome; final List<String> jvmOptions; final Map<String, String> systemProperties; final Path executableJar; final List<String> programArgs; }