Examples of SimpleHttpResponse


Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpResponse

    {
        OverflowHandler handler = new OverflowHandler(false);
        server.setHandler(handler);
        server.start();

        SimpleHttpResponse response = executeRequest();

        assertThat("response code is 200", response.getCode(), is("200"));
        assertResponseBody(response, "foobar");
        if (!"HTTP/1.0".equals(httpVersion))
            assertHeader(response, "transfer-encoding", "chunked");
        assertThat("no exceptions", handler.failure(), is(nullValue()));
    }
View Full Code Here

Examples of org.eclipse.jetty.toolchain.test.http.SimpleHttpResponse

    {
        OverflowHandler handler = new OverflowHandler(true);
        server.setHandler(handler);
        server.start();

        SimpleHttpResponse response = executeRequest();

        // Buffer size is too small, so the content is written directly producing a 200 response
        assertThat("response code is 200", response.getCode(), is("200"));
        assertResponseBody(response, "foobar");
        if (!"HTTP/1.0".equals(httpVersion))
            assertHeader(response, "transfer-encoding", "chunked");
        assertThat("no exceptions", handler.failure(), is(nullValue()));
    }
View Full Code Here

Examples of waffle.apache.catalina.SimpleHttpResponse

    @Test
    public void testChallengeGET() {
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.setMethod("GET");
        final SimpleHttpResponse response = new SimpleHttpResponse();
        this.authenticator.authenticate(request, response, null);
        final String[] wwwAuthenticates = response.getHeaderValues("WWW-Authenticate");
        Assert.assertNotNull(wwwAuthenticates);
        Assert.assertEquals(2, wwwAuthenticates.length);
        Assert.assertEquals("Negotiate", wwwAuthenticates[0]);
        Assert.assertEquals("NTLM", wwwAuthenticates[1]);
        Assert.assertEquals("close", response.getHeader("Connection"));
        Assert.assertEquals(2, response.getHeaderNames().size());
        Assert.assertEquals(401, response.getStatus());
    }
View Full Code Here

Examples of waffle.mock.http.SimpleHttpResponse

    @Test
    public void testGetInfo() throws Exception {
        SimpleHttpRequest request = new SimpleHttpRequest();
        request.addHeader("hello", "waffle");

        SimpleHttpResponse response = new SimpleHttpResponse();

        WaffleInfoServlet servlet = new WaffleInfoServlet();
        servlet.doGet(request, response);

        String xml = response.getOutputText();
        Document doc = loadXMLFromString(xml);

        WaffleInfoServletTests.LOGGER.info("GOT: {}", xml);

        // Make sure JNA Version is properly noted
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.