Examples of IHttpResponse


Examples of org.xlightweb.IHttpResponse

        HttpClient httpClient = new HttpClient(SSLTestContextFactory.getSSLContext());
        httpClient.setProxyHost("localhost");
        httpClient.setProxyPort(proxy.getLocalPort());
       
        IHttpResponse response = httpClient.call(new GetRequest("https://localhost:" + secServer.getLocalPort() + "/"));
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("OK", response.getBody().readString());
       
        QAUtil.sleep(500);
       
        response = httpClient.call(new GetRequest("https://localhost:" + secServer.getLocalPort() + "/"));
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("OK", response.getBody().readString());
       
        QAUtil.sleep(500);
        Assert.assertEquals(1, secServer.getNumHandledConnections())// connection should have been reused
       
        httpClient.close();
View Full Code Here

Examples of org.xlightweb.IHttpResponse

        server.start();

        HttpClient httpClient = new HttpClient(SSLTestContextFactory.getSSLContext());
       
        IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("OK", response.getBody().readString());

        QAUtil.sleep(500);
       
        response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("OK", response.getBody().readString());

        QAUtil.sleep(500);
        Assert.assertEquals(1, server.getNumHandledConnections())// connection has been reused
       
        httpClient.close();
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.