Package org.xlightweb.client

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



    HttpClientConnection httpCon = new HttpClientConnection("localhost", server.getLocalPort());

    for (int i = 0; i < 10; i++) {
      httpCon.send(new GetRequest("/tztz?id=" + i), responseHandler);
    }


    do {
      QAUtil.sleep(300);
View Full Code Here



    HttpClientConnection httpCon = new HttpClientConnection("localhost", servletEngine.getLocalPort());

    for (int i = 0; i < 10; i++) {
      httpCon.send(new GetRequest("/tztz?id=" + i), responseHandler);
    }


    do {
      QAUtil.sleep(300);
View Full Code Here

       
        for (int i = 0; i < 100; i++) {
            HttpClientConnection con = pool.getHttpClientConnection("localhost", container.getLocalPort());
           
            FutureResponseHandler respHdl = new FutureResponseHandler();
            BodyDataSink dataSink = con.send(new HttpRequestHeader("POST", "http://localhost:" + container.getLocalPort() + "/test"), respHdl);
           
            dataSink.write("test");
           
            IHttpResponse response = respHdl.getResponse();
            Assert.assertEquals(200, response.getStatus());
View Full Code Here

    MyWorkerPool wp = new MyWorkerPool();
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    con.setWorkerpool(wp)
   
    ResponseHandler rh = new ResponseHandler(1);
    con.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/"), rh);
    QAUtil.sleep(300);
    Assert.assertEquals(1, wp.getRunning());
   
   
    con.close();
View Full Code Here

    MyWorkerPool wp = new MyWorkerPool();
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    con.setWorkerpool(wp)
   
    ResponseHandler2 rh = new ResponseHandler2();
    con.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/"), rh);
    QAUtil.sleep(500);
    Assert.assertTrue(rh.getDataHandlerThreadName().startsWith("worker#"));
   
   
    con.close();
View Full Code Here

       
        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

       
        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


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

      public void onException(IOException ioe) {
      }
    };


    BodyDataSink outChannel = con.send(new HttpRequestHeader("POST", "/"), 100, resHdl);

    outChannel.write(QAUtil.generateByteArray(100));
   
    outChannel.close();
   
View Full Code Here

     
      HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
     
     
      FutureResponseHandler respHandler = new FutureResponseHandler();
      BodyDataSink dataSink = con.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/"), respHandler);
      dataSink.write("test");
      QAUtil.sleep(300);
     
      dataSink.write("123");
      QAUtil.sleep(300);
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.