Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2014-05-02 21:08:19 +0000
committerSimone Bordet2014-05-03 09:24:12 +0000
commita0eba0d48d5c5463a32b319f535a2a370ebce10c (patch)
treec50aaac8338fceead74bf430080231c3e7712a7e
parenteb9b4a5ac01a3180bda38a1a59fb82ad1a51f9e4 (diff)
downloadorg.eclipse.jetty.project-a0eba0d48d5c5463a32b319f535a2a370ebce10c.tar.gz
org.eclipse.jetty.project-a0eba0d48d5c5463a32b319f535a2a370ebce10c.tar.xz
org.eclipse.jetty.project-a0eba0d48d5c5463a32b319f535a2a370ebce10c.zip
Fixed tests that broke due to changes in handling of white spaces
between HTTP messages introduced by commit 95c6bad6545604ffa23024ac0092bd9629a520d7.
-rw-r--r--tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java15
-rw-r--r--tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java16
2 files changed, 7 insertions, 24 deletions
diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java
index 50550425b2..5c6178e344 100644
--- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java
+++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java
@@ -18,10 +18,6 @@
package org.eclipse.jetty.test.support.rawhttp;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
-
import java.io.IOException;
import java.util.List;
@@ -31,6 +27,10 @@ import org.eclipse.jetty.http.HttpTester;
import org.junit.Assert;
import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertThat;
+
public class HttpResponseTesterTest
{
@Test
@@ -85,7 +85,8 @@ public class HttpResponseTesterTest
rawResponse.append("\n");
rawResponse.append("Host=Default\n");
rawResponse.append("Resource=R1\n");
-
+ rawResponse.append("\n");
+
rawResponse.append("HTTP/1.1 200 OK\n");
rawResponse.append("Date: Mon, 08 Jun 2009 23:05:26 GMT\n");
rawResponse.append("Content-Type: text/plain\n");
@@ -96,9 +97,7 @@ public class HttpResponseTesterTest
rawResponse.append("\n");
rawResponse.append("Host=Default\n");
rawResponse.append("Resource=R2\n");
- rawResponse.append("\n");
-
-
+
List<HttpTester.Response> responses = HttpTesting.readResponses(rawResponse.toString());
Assert.assertNotNull("Responses should not be null",responses);
diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java
index 3bd3646c66..5afeaad322 100644
--- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java
+++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java
@@ -117,22 +117,6 @@ public class HttpTesting
}
-
-
- public static List<HttpTester.Response> readResponses(ByteBuffer buffer) throws IOException
- {
- List<HttpTester.Response> list = new ArrayList<>();
-
- while(BufferUtil.hasContent(buffer))
- {
- HttpTester.Response response = HttpTester.parseResponse(buffer);
- if (response == null)
- break;
- list.add(HttpTester.parseResponse(buffer));
- }
- return list;
- }
-
public static List<HttpTester.Response> readResponses(String string) throws IOException
{
List<HttpTester.Response> list = new ArrayList<>();

Back to the top