Examples of GetRequest


Examples of org.xlightweb.GetRequest

    IServer server = new Server(hdl);
    server.start();
   
   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    IHttpResponse response = con.call(new GetRequest("/"));
   
    Assert.assertEquals(200, response.getStatus());
    Assert.assertEquals("12345", response.getBlockingBody().readString());
   
    con.close();
View Full Code Here

Examples of org.xlightweb.GetRequest

   
    IServer server = new Server(hdl);
    server.start();

    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    IHttpResponse response = con.call(new GetRequest("/"));
   
    String body = response.getBlockingBody().readString();
   
    Assert.assertEquals(200, response.getStatus());
    Assert.assertTrue(response.getContentType() == null);
View Full Code Here

Examples of org.xlightweb.GetRequest

        IServer server = new Server(hdl);
        server.start();
       
       
        HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
        IHttpResponse response = con.call(new GetRequest("/"));
       
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("12345", response.getBlockingBody().readString());
        Assert.assertEquals("me", response.getServer());
       
View Full Code Here

Examples of org.xlightweb.GetRequest

        IServer server = new Server(hdl);
        server.start();
       
       
        HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
        IHttpResponse response = con.call(new GetRequest("/"));
       
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("12345", response.getBlockingBody().readString());
        Assert.assertEquals("me", response.getServer());
       
View Full Code Here

Examples of org.xlightweb.GetRequest

        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
       
        IHttpRequest request = new GetRequest("http://localhost:" + server.getLocalPort() + "/");
        request.setHeader("If-None-Match", "\"23\"");
        IHttpResponse resp = httpClient.call(request);
        Assert.assertEquals(304, resp.getStatus());
        Assert.assertNull(resp.getHeader(CacheHandler.XHEADER_NAME));
       
        QAUtil.sleep(1000);
View Full Code Here

Examples of org.xlightweb.GetRequest

        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, resp.getStatus());
        Assert.assertEquals("test", resp.getBody().readString());
        Assert.assertNull(resp.getHeader(CacheHandler.XHEADER_NAME));
        String lastModified = resp.getHeader("Last-Modified");
       
        QAUtil.sleep(1000);
       
        IHttpRequest request = new GetRequest("http://localhost:" + server.getLocalPort() + "/");
        request.setHeader("If-Modified-Since", lastModified);
        resp = httpClient.call(request);
        Assert.assertEquals(304, resp.getStatus());
        Assert.assertNull(resp.getHeader(CacheHandler.XHEADER_NAME));
       
        QAUtil.sleep(1000);
View Full Code Here

Examples of org.xlightweb.GetRequest

    ConnectionUtils.registerMBean(server);
   
    HttpClient httpClient = new HttpClient();

    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/s/"));
    Assert.assertEquals(200, response.getStatus());

    QAUtil.sleep(1000);

   
View Full Code Here

Examples of org.xlightweb.GetRequest

       
        long start = System.currentTimeMillis();
       
       
        ResponseHandler respHdl = new ResponseHandler();
        con.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/test?delay=2000"), respHdl);
       
        while (respHdl.getResponse() == null) {
            QAUtil.sleep(100);
        }
       
View Full Code Here

Examples of org.xlightweb.GetRequest

       
        long start = System.currentTimeMillis();
       
       
        OnMesageResponseHandler respHdl = new OnMesageResponseHandler();
        con.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/test?delay=2000"), respHdl);
       
        while (respHdl.getResponse() == null) {
            QAUtil.sleep(100);
        }
       
View Full Code Here

Examples of org.xlightweb.GetRequest

       
        long start = System.currentTimeMillis();
       
       
        OnMesageResponseHandler respHdl = new OnMesageResponseHandler();
        httpClient.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/test?delay=2000"), respHdl);
       
        while (respHdl.getResponse() == null) {
            QAUtil.sleep(100);
        }
       
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.