Code example for ConnectionReuseStrategy

Methods: keepAlive

0
    } 
 
    @Test 
    public void testNoContentLengthResponseHttp1_0() throws Exception { 
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 200, "OK");
        Assert.assertFalse(reuseStrategy.keepAlive(response, context));
    } 
 
    @Test 
    public void testNoContentLengthResponseHttp1_1() throws Exception { 
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        Assert.assertFalse(reuseStrategy.keepAlive(response, context));
    } 
 
    @Test 
    public void testChunkedContent() throws Exception { 
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
        response.addHeader("Transfer-Encoding", "chunked");
        Assert.assertTrue(reuseStrategy.keepAlive(response, context));
    }