Search in sources :

Example 21 with LocalEndPoint

use of org.eclipse.jetty.server.LocalConnector.LocalEndPoint in project jetty.project by eclipse.

the class LocalConnectorTest method testThreeResponsePipeline_11.

@Test
public void testThreeResponsePipeline_11() throws Exception {
    LocalEndPoint endp = _connector.connect();
    endp.addInput("GET /R1 HTTP/1.1\r\n" + "Host: localhost\r\n" + "\r\n" + "GET /R2 HTTP/1.1\r\n" + "Host: localhost\r\n" + "\r\n" + "GET /R3 HTTP/1.1\r\n" + "Host: localhost\r\n" + "\r\n");
    String response = endp.getResponse();
    assertThat(response, containsString("HTTP/1.1 200 OK"));
    assertThat(response, containsString("pathInfo=/R1"));
    response = endp.getResponse();
    assertThat(response, containsString("HTTP/1.1 200 OK"));
    assertThat(response, containsString("pathInfo=/R2"));
    response = endp.getResponse();
    assertThat(response, containsString("HTTP/1.1 200 OK"));
    assertThat(response, containsString("pathInfo=/R3"));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) LocalEndPoint(org.eclipse.jetty.server.LocalConnector.LocalEndPoint) Test(org.junit.Test)

Aggregations

LocalEndPoint (org.eclipse.jetty.server.LocalConnector.LocalEndPoint)21 Test (org.junit.Test)21 Matchers.containsString (org.hamcrest.Matchers.containsString)14 IOException (java.io.IOException)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)3 ArrayList (java.util.ArrayList)2 Resource (org.eclipse.jetty.util.resource.Resource)2 FilterInputStream (java.io.FilterInputStream)1 InputStream (java.io.InputStream)1 ByteBuffer (java.nio.ByteBuffer)1 ReadableByteChannel (java.nio.channels.ReadableByteChannel)1 ServletInputStream (javax.servlet.ServletInputStream)1 Cookie (javax.servlet.http.Cookie)1 AbstractHandler (org.eclipse.jetty.server.handler.AbstractHandler)1 ContextHandler (org.eclipse.jetty.server.handler.ContextHandler)1