Package org.xlightweb.client

Examples of org.xlightweb.client.HttpClientConnection.call()


    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


    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

    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

   
    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

        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

        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

   

    IHttpRequest request = new GetRequest("/" + file.getName());
    request.setHeader("Range", "bytes=70-");
   
    IHttpResponse response = con.call(request);
   
    Assert.assertEquals(206, response.getStatus());
    Assert.assertEquals("head>", response.getBody().readString());
   
    file.delete();
View Full Code Here

   

    IHttpRequest request = new GetRequest("/" + file.getName());
    request.setHeader("Range", "bytes=74-74");
   
    IHttpResponse response = con.call(request);
   
    Assert.assertEquals(206, response.getStatus());
    Assert.assertEquals(">", response.getBody().readString());
   
    file.delete();
View Full Code Here

   

    IHttpRequest request = new GetRequest("/" + file.getName());
    request.setHeader("Range", "bytes=0-0");
   
    IHttpResponse response = con.call(request);
   
    Assert.assertEquals(206, response.getStatus());
    Assert.assertEquals("<", response.getBody().readString());
   
    file.delete();
View Full Code Here

   

    IHttpRequest request = new GetRequest("/" + file.getName());
    request.setHeader("Range", "bytes=-10");
   
    IHttpResponse response = con.call(request);
   
    Assert.assertEquals(206, response.getStatus());
    Assert.assertEquals("le></head>", response.getBody().readString());
   
    file.delete();
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.