From 407d54152d2808092a4ece5114c3c1e93c9ad232 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 2 Oct 2008 01:44:45 +0000 Subject: [PATCH] base directory needs to be set manually git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@12455 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/org/jvnet/hudson/test/HudsonTestCase.java | 7 +++++++ test/src/test/java/hudson/slaves/JNLPLauncherTest.java | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 fb3037b7e9..ab0b7d6ddf 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 c836676323..0b0a637869 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; } -- GitLab