Package org.xlightweb.client

Examples of org.xlightweb.client.IHttpClientEndpoint


      ConnectHandler ch = new ConnectHandler();
      new NonBlockingConnection(InetAddress.getByName("www.web.de"), 80, ch, false, 2000);
     
      QAUtil.sleep(1500);
     
      IHttpClientEndpoint httpEndpoint = ch.getHttpConnection();
      IHttpResponse response = httpEndpoint.call(new GetRequest("/"));

      Assert.assertTrue((response.getStatus() >= 200) && (response.getStatus() < 400));
  }
View Full Code Here


    IServer server = new HttpServer(new HeaderInfoServerHandler());
    server.start();

    IHttpClientEndpoint httpClient = new HttpClient();

    NonThreadedResponseHandler hdl = new NonThreadedResponseHandler();
    httpClient.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/"), hdl);

    while (hdl.getResponse() == null) {
        QAUtil.sleep(100);
    }

    IHttpResponse response = hdl.getResponse();

    httpClient.close();
    server.close();

    Assert.assertTrue(hdl.getThreadname().startsWith("xDispatcher"));
    Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

    IServer server = new HttpServer(new HeaderInfoServerHandler());
    server.start();

    IHttpClientEndpoint httpClient = new HttpClient();

    NonThreadedResponseHandler hdl = new NonThreadedResponseHandler();
    httpClient.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/"), hdl);

    while (hdl.getResponse() == null) {
        QAUtil.sleep(100);
    }

    IHttpResponse response = hdl.getResponse();

    httpClient.close();
    server.close();

    Assert.assertTrue(hdl.getThreadname().startsWith("xDispatcher"));
    Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

      ConnectHandler ch = new ConnectHandler();
      new NonBlockingConnection(InetAddress.getByName("www.web.de"), 80, ch, false, 2000);
     
      QAUtil.sleep(1500);
     
      IHttpClientEndpoint httpEndpoint = ch.getHttpConnection();
      IHttpResponse response = httpEndpoint.call(new GetRequest("/"));

      Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

      ConnectHandler ch = new ConnectHandler();
      new NonBlockingConnection(InetAddress.getByName("www.web.de"), 80, ch, false, 2000);
     
      QAUtil.sleep(1500);
     
      IHttpClientEndpoint httpEndpoint = ch.getHttpConnection();
      IHttpResponse response = httpEndpoint.call(new GetRequest("/"));

      Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

    IServer server = new HttpServer(new HeaderInfoServerHandler());
    server.start();


    IHttpClientEndpoint httpClient = new HttpClient();

    NonThreadedResponseHandler hdl = new NonThreadedResponseHandler();
    httpClient.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/"), hdl);

    QAUtil.sleep(500);

    IHttpResponse response = hdl.getResponse();


    httpClient.close();
    server.close();

    Assert.assertTrue(hdl.threadname.startsWith("xDispatcher"));
    Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

    IServer server = new HttpServer(new HeaderInfoServerHandler());
    server.start();

    IHttpClientEndpoint httpClient = new HttpClient();

    NonThreadedResponseHandler hdl = new NonThreadedResponseHandler();
    httpClient.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/"), hdl);

    while (hdl.getResponse() == null) {
        QAUtil.sleep(100);
    }

    IHttpResponse response = hdl.getResponse();

    httpClient.close();
    server.close();

    Assert.assertTrue(hdl.getThreadname().startsWith("xDispatcher"));
    Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

      ConnectHandler ch = new ConnectHandler();
      new NonBlockingConnection(InetAddress.getByName("www.web.de"), 80, ch, false, 2000);
     
      QAUtil.sleep(1500);
     
      IHttpClientEndpoint httpEndpoint = ch.getHttpConnection();
      IHttpResponse response = httpEndpoint.call(new GetRequest("/"));

      Assert.assertEquals(200, response.getStatus());
  }
View Full Code Here

  @Test
  public void testStringBodyData() throws Exception {
    System.out.println("testStringBodyData");
   
    IHttpClientEndpoint httpClient = new HttpClient();

    IServer server = new HttpServer(new EchoHandler());
    server.start();



    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen."));
    String body = response.getBody().readString();

    server.close();
    httpClient.close();

    Assert.assertEquals("Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen.", body);
  }
View Full Code Here

  @Test
  public void testPlainTransferEncoding() throws Exception {
    System.out.println("testPlainTransferEncoding");
   
    IHttpClientEndpoint httpClient = new HttpClient();

    IServer server = new HttpServer(new EchoHandler());
    server.start();



    IHttpResponse response = httpClient.call(new PostRequest("http://localhost:" + server.getLocalPort() + "/", "text/plain", "Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen."));
    String body = response.getBody().readString();

    server.close();
    httpClient.close();

    Assert.assertEquals("Herzlichen Gl\u00FCckwunsch, Sie haben sich zur Reinigung des Aufzugs entschlossen.", body);
  }
View Full Code Here

TOP

Related Classes of org.xlightweb.client.IHttpClientEndpoint

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.