Use File.createTempFile for test output directory for RequestTest

This commit is contained in:
Jan Bartel 2013-11-04 17:35:11 +11:00
parent 17bf8ccee0
commit 4073e772c4
1 changed files with 5 additions and 4 deletions

View File

@ -214,10 +214,11 @@ 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();