From 009a4659a75c81010ccbca58419993c30871e18d Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 12 Feb 2019 19:21:43 +0100 Subject: [PATCH] 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 --- .../jetty/tests/distribution/DistributionTester.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java b/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java index 57571c4d0c0..79a0d206210 100644 --- a/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java +++ b/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/DistributionTester.java @@ -130,18 +130,21 @@ public class DistributionTester */ public DistributionTester.Run start(List args) throws Exception { + File jettyBaseDir = config.jettyBase.toFile(); + Path workDir = Files.createDirectories(jettyBaseDir.toPath().resolve("work")); + List commands = new ArrayList<>(); commands.add(getJavaExecutable()); + commands.add("-Djava.io.tmpdir=" + workDir.toAbsolutePath().toString()); commands.add("-jar"); commands.add(config.jettyHome.toAbsolutePath() + "/start.jar"); commands.addAll(args); - File workingDir = config.jettyBase.toFile(); LOGGER.info("Executing: {}", commands); - LOGGER.info("Working Dir: {}", workingDir.getAbsolutePath()); + LOGGER.info("Working Dir: {}", jettyBaseDir.getAbsolutePath()); ProcessBuilder pbCmd = new ProcessBuilder(commands); - pbCmd.directory(workingDir); + pbCmd.directory(jettyBaseDir); Process process = pbCmd.start(); return new Run(process);