Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2012-02-24 09:40:39 +0000
committerSimone Bordet2012-02-24 09:40:39 +0000
commit3a821765311b0428fbbb6a50b2cc42739af706ce (patch)
tree675502c6d3a201d0703836ad68a9531b8afc9da7
parentc9c5bd3b474048724ce80c2dd93ca90473690bbb (diff)
parentb29f37175880403f218b650a37f0a79abdab6ac0 (diff)
downloadorg.eclipse.jetty.project-3a821765311b0428fbbb6a50b2cc42739af706ce.tar.gz
org.eclipse.jetty.project-3a821765311b0428fbbb6a50b2cc42739af706ce.tar.xz
org.eclipse.jetty.project-3a821765311b0428fbbb6a50b2cc42739af706ce.zip
Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java4
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java20
2 files changed, 20 insertions, 4 deletions
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java
index 4aff852cdc..b6a030ab89 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipWithPipeliningTest.java
@@ -102,7 +102,7 @@ public class GzipWithPipeliningTest
client.connect();
// Request text that will be gzipped + chunked in the response
- client.issueGET("/lots-of-fantasy-names.txt",true);
+ client.issueGET("/lots-of-fantasy-names.txt",true, false);
respHeader = client.readResponseHeader();
System.out.println("Response Header #1 --\n" + respHeader);
@@ -122,7 +122,7 @@ public class GzipWithPipeliningTest
System.out.printf("Read %,d bytes%n",readBytes);
// Issue another request
- client.issueGET("/jetty_logo.png",true);
+ client.issueGET("/jetty_logo.png",true, false);
// Finish reading chunks
System.out.println("Finish reading remaining chunks ...");
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java
index 9dc4944bd6..f5d72b279e 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java
@@ -64,7 +64,7 @@ public class PipelineHelper
* to turn on acceptance of GZIP compressed responses
* @throws IOException
*/
- public void issueGET(String path, boolean acceptGzipped) throws IOException
+ public void issueGET(String path, boolean acceptGzipped, boolean close) throws IOException
{
LOG.debug("Issuing GET on " + path);
StringBuilder req = new StringBuilder();
@@ -79,7 +79,15 @@ public class PipelineHelper
req.append("Accept-Encoding: gzip, deflate\r\n");
}
req.append("Cookie: JSESSIONID=spqx8v8szylt1336t96vc6mw0\r\n");
- req.append("Connection: keep-alive\r\n");
+ if ( close )
+ {
+ req.append("Connection: close\r\n");
+ }
+ else
+ {
+ req.append("Connection: keep-alive\r\n");
+ }
+
req.append("\r\n");
LOG.debug("Request:" + req);
@@ -189,6 +197,14 @@ public class PipelineHelper
while (left > 0)
{
int val = inputStream.read();
+ try
+ {
+ Thread.sleep(10);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
if (val == (-1))
{
Assert.fail(String.format("Encountered an early EOL (expected another %,d bytes)",left));

Back to the top