Package org.xlightweb

Examples of org.xlightweb.GetRequest


    httpClient.setProxySecuredHost("localhost");
    httpClient.setProxySecuredPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
    httpClient.setProxyPassword("test");

    IHttpResponse response = httpClient.call(new GetRequest("https://localhost:" + server.getLocalPort() + "/"));
   
    String body = response.getBlockingBody().readString();

    Assert.assertEquals(200, response.getStatus());
    Assert.assertTrue(body.indexOf("it works") != -1);
View Full Code Here


        httpClient.setProxyHost("localhost");
        httpClient.setProxyPort(proxy.getLocalPort());
        httpClient.setProxyUser("test");
        httpClient.setProxyPassword("test");

        IHttpResponse response = httpClient.call(new GetRequest("https://localhost:" + server.getLocalPort() + "/"));
       
        String body = response.getBlockingBody().readString();

        Assert.assertEquals(200, response.getStatus());
        Assert.assertTrue(body.indexOf("it works") != -1);
View Full Code Here

    httpClient.setProxyPort(proxy.getLocalPort());
    httpClient.setProxyUser("test");
    httpClient.setProxyPassword("test");
   

    IHttpResponse response = httpClient.call(new GetRequest("http://www.amazon.de/"));
   
    Assert.assertEquals(200, response.getStatus());
    Assert.assertTrue(response.getBlockingBody().readString().indexOf("amazon") != -1);
   
   
View Full Code Here

    httpClient.setProxyUser("test");
   

    try {
      LOG.fine("call");
      httpClient.call(new GetRequest("http://www.amazon.de/"));
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
   
    LOG.fine("returned");
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());
    Assert.assertEquals("", response.getHeader("ETag"));
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("its 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("its 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());
   
    con.close();
View Full Code Here

    server.start();
   
   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    try {
      IHttpResponse response = con.call(new GetRequest("/"));
      response.getBlockingBody().readString();
      Assert.fail("IOException expected");
    } catch (IOException expected) {  }
   
    con.close();
View Full Code Here

TOP

Related Classes of org.xlightweb.GetRequest

Copyright © 2018 www.massapicom. 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.