aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-09-10 06:03:03 (EDT)
committerThomas Becker2013-09-10 06:03:03 (EDT)
commit9db0101d698e85ca2e21ffc27d698c1df02f4d33 (patch)
tree9c5061dee3668e2eba61329133f66b1ec950d40e
parentfefab2af969f152d524ee0cdc4a5e0e29e180bef (diff)
downloadorg.eclipse.jetty.project-9db0101d698e85ca2e21ffc27d698c1df02f4d33.zip
org.eclipse.jetty.project-9db0101d698e85ca2e21ffc27d698c1df02f4d33.tar.gz
org.eclipse.jetty.project-9db0101d698e85ca2e21ffc27d698c1df02f4d33.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];