diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index fb3037b7e925981950c2a7c6a05c9bc1c457895c..ab0b7d6ddf1e7f8e70d61fa283723960c1832473 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -223,6 +223,13 @@ public abstract class HudsonTestCase extends TestCase { return new LocalLauncher(new StreamTaskListener(System.out)); } + /** + * Allocates a new temporary directory for the duration of this test. + */ + protected File createTmpDir() throws IOException { + return TestEnvironment.get().temporaryDirectoryAllocator.allocate(); + } + /** * Returns the last item in the list. */ diff --git a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java index c8366763235d74ffb54724bb58e622e457a19395..0b0a637869d040c852b2452934f72a8c554e1b18 100644 --- a/test/src/test/java/hudson/slaves/JNLPLauncherTest.java +++ b/test/src/test/java/hudson/slaves/JNLPLauncherTest.java @@ -43,7 +43,9 @@ public class JNLPLauncherTest extends HudsonTestCase { ArgumentListBuilder args = new ArgumentListBuilder(); args.add("java","-jar"); args.add(Which.jarFile(netx.jnlp.runtime.JNLPRuntime.class).getAbsolutePath()); - args.add("-headless","-nosecurity","-jnlp", getJnlpLink(c)); + args.add("-headless","-basedir"); + args.add(createTmpDir()); + args.add("-nosecurity","-jnlp", getJnlpLink(c)); return args; }