Fixed tests that broke due to changes in handling of white spaces

between HTTP messages introduced by commit
95c6bad654.
This commit is contained in:
Simone Bordet 2014-05-02 23:08:19 +02:00
parent 11096e8a0d
commit 6fc645514e
2 changed files with 7 additions and 24 deletions

View File

@ -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);

View File

@ -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<>();