From 4073e772c43879b210a3499e3880d996628ff7c0 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Mon, 4 Nov 2013 17:35:11 +1100 Subject: [PATCH] Use File.createTempFile for test output directory for RequestTest --- .../test/java/org/eclipse/jetty/server/RequestTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java index c9b38bb495d..46f0fe3ea9b 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java @@ -213,11 +213,12 @@ public class RequestTest @Test public void testMultiPart() throws Exception - { - final File tmpDir = new File (System.getProperty("java.io.tmpdir")); - final File testTmpDir = new File (tmpDir, "reqtest"); + { + final File testTmpDir = File.createTempFile("reqtest", null); + if (testTmpDir.exists()) + testTmpDir.delete(); + testTmpDir.mkdir(); testTmpDir.deleteOnExit(); - assertTrue(testTmpDir.mkdirs()); assertTrue(testTmpDir.list().length == 0); ContextHandler contextHandler = new ContextHandler();