Issue #3343 - Add an API/tools to be able to test Jetty Distribution.
Made sure web apps are unpacked in a directory within $jetty.base to avoid cluttering /tmp. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
6aa917080f
commit
009a4659a7
|
@ -130,18 +130,21 @@ public class DistributionTester
|
||||||
*/
|
*/
|
||||||
public DistributionTester.Run start(List<String> args) throws Exception
|
public DistributionTester.Run start(List<String> args) throws Exception
|
||||||
{
|
{
|
||||||
|
File jettyBaseDir = config.jettyBase.toFile();
|
||||||
|
Path workDir = Files.createDirectories(jettyBaseDir.toPath().resolve("work"));
|
||||||
|
|
||||||
List<String> commands = new ArrayList<>();
|
List<String> commands = new ArrayList<>();
|
||||||
commands.add(getJavaExecutable());
|
commands.add(getJavaExecutable());
|
||||||
|
commands.add("-Djava.io.tmpdir=" + workDir.toAbsolutePath().toString());
|
||||||
commands.add("-jar");
|
commands.add("-jar");
|
||||||
commands.add(config.jettyHome.toAbsolutePath() + "/start.jar");
|
commands.add(config.jettyHome.toAbsolutePath() + "/start.jar");
|
||||||
commands.addAll(args);
|
commands.addAll(args);
|
||||||
|
|
||||||
File workingDir = config.jettyBase.toFile();
|
|
||||||
LOGGER.info("Executing: {}", commands);
|
LOGGER.info("Executing: {}", commands);
|
||||||
LOGGER.info("Working Dir: {}", workingDir.getAbsolutePath());
|
LOGGER.info("Working Dir: {}", jettyBaseDir.getAbsolutePath());
|
||||||
|
|
||||||
ProcessBuilder pbCmd = new ProcessBuilder(commands);
|
ProcessBuilder pbCmd = new ProcessBuilder(commands);
|
||||||
pbCmd.directory(workingDir);
|
pbCmd.directory(jettyBaseDir);
|
||||||
Process process = pbCmd.start();
|
Process process = pbCmd.start();
|
||||||
|
|
||||||
return new Run(process);
|
return new Run(process);
|
||||||
|
|
Loading…
Reference in New Issue