aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-09-10 06:03:03 (EDT)
committerThomas Becker2013-09-10 12:02:46 (EDT)
commit911043b5be2b1a87905401693b959f80ce38a629 (patch)
treec685d55fcab5fcb6cb1b18237236d8541d3e2153
parentab9ecd277d97d3e9877e8b741ad942877e8d3668 (diff)
downloadorg.eclipse.jetty.project-911043b5be2b1a87905401693b959f80ce38a629.zip
org.eclipse.jetty.project-911043b5be2b1a87905401693b959f80ce38a629.tar.gz
org.eclipse.jetty.project-911043b5be2b1a87905401693b959f80ce38a629.tar.bz2
ProxyServletTest create test dir if it doesn't exist
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java
index e8e761f..f0d343c 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ProxyServletTest.java
@@ -18,6 +18,22 @@
package org.eclipse.jetty.servlets;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
+import java.net.Socket;
+import java.util.Arrays;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import junit.framework.Assert;
import org.eclipse.jetty.client.ContentExchange;
import org.eclipse.jetty.client.HttpClient;
@@ -34,23 +50,9 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
-import org.hamcrest.core.Is;
-import org.hamcrest.core.IsEqual;
import org.junit.After;
import org.junit.Test;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
@@ -138,7 +140,9 @@ public class ProxyServletTest
public void testBigDownloadWithSlowReader() throws Exception
{
// Create a 6 MiB file
- final File file = File.createTempFile("test_", null, MavenTestingUtils.getTargetTestingDir());
+ File targetTestingDir = MavenTestingUtils.getTargetTestingDir();
+ targetTestingDir.mkdir();
+ final File file = File.createTempFile("test_", null, targetTestingDir);
file.deleteOnExit();
FileOutputStream fos = new FileOutputStream(file);
byte[] buffer = new byte[1024];