Examples of keepAlive()


Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

    }

    public void testIllegalResponseArg() throws Exception {
        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        try {
            s.keepAlive(null);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_0, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);
        response.setEntity(entity);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertFalse(s.keepAlive(response));
    }

    public void testNoContentLengthResponseHttp1_1() throws Exception {
        BasicHttpEntity entity = new BasicHttpEntity();
        entity.setChunked(false);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_1, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);
        response.setEntity(entity);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertFalse(s.keepAlive(response));
    }

    public void testChunkedContent() throws Exception {
        BasicHttpEntity entity = new BasicHttpEntity();
        entity.setChunked(true);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_1, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);
        response.setEntity(entity);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertTrue(s.keepAlive(response));
    }

    public void testIgnoreInvalidKeepAlive() throws Exception {
        BasicHttpEntity entity = new BasicHttpEntity();
        entity.setChunked(false);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

        HttpResponse response = new BasicHttpResponse(statusline);
        response.addHeader(new Header("Connection", "keep-alive"));
        response.setEntity(entity);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertFalse(s.keepAlive(response));
    }
   
    public void testExplicitClose() throws Exception {
        BasicHttpEntity entity = new BasicHttpEntity();
        entity.setChunked(true);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

        HttpResponse response = new BasicHttpResponse(statusline);
        response.addHeader(new Header("Connection", "close"));
        response.setEntity(entity);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertFalse(s.keepAlive(response));
    }
   
    public void testExplicitKeepAlive() throws Exception {
        BasicHttpEntity entity = new BasicHttpEntity();
        entity.setChunked(false);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

        HttpResponse response = new BasicHttpResponse(statusline);
        response.addHeader(new Header("Connection", "keep-alive"));
        response.setEntity(entity);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertTrue(s.keepAlive(response));
    }

    public void testHTTP10Default() throws Exception {
        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_0, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

    public void testHTTP10Default() throws Exception {
        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_0, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertFalse(s.keepAlive(response));
    }
   
    public void testHTTP11Default() throws Exception {
        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_1, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

    public void testHTTP11Default() throws Exception {
        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_1, 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertTrue(s.keepAlive(response));
    }

    public void testFutureHTTP() throws Exception {
        StatusLine statusline = new StatusLine(new HttpVersion(3, 45), 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);
View Full Code Here

Examples of org.apache.http.ConnectionReuseStrategy.keepAlive()

    public void testFutureHTTP() throws Exception {
        StatusLine statusline = new StatusLine(new HttpVersion(3, 45), 200, "OK");
        HttpResponse response = new BasicHttpResponse(statusline);

        ConnectionReuseStrategy s = new DefaultConnectionReuseStrategy();
        assertTrue(s.keepAlive(response));
    }
   
    public void testBrokenConnectionDirective1() throws Exception {
        // Use HTTP 1.0
        StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_0, 200, "OK");
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.