Package org.xlightweb

Examples of org.xlightweb.HttpRequestHeader


    server.start();
   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
   
    FutureResponseHandler respHdl = new FutureResponseHandler();
    BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/"), 100, respHdl);
    bodyDataSink.write(QAUtil.generateByteArray(100));
    bodyDataSink.close();
   
    IHttpResponse response = respHdl.getResponse();
    Assert.assertEquals(200, response.getStatus());
View Full Code Here


    server.start();
   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
   
    FutureResponseHandler respHdl = new FutureResponseHandler();
    BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/"), respHdl);
    bodyDataSink.write(QAUtil.generateByteArray(100));
    bodyDataSink.close();
   
    IHttpResponse response = respHdl.getResponse();
    Assert.assertEquals(200, response.getStatus());
View Full Code Here

 
    HttpClient httpClient = new HttpClient();
   
   
    FutureResponseHandler respHdl = new FutureResponseHandler();
    BodyDataSink outChannel = httpClient.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/conversation"), respHdl);
    outChannel.flush();
   
    BodyDataSource inChannel = respHdl.getResponse().getBody();
    inChannel.readStringByDelimiter("\r\n"); // read greeting
   
View Full Code Here

         
        };
       
       
       
        BodyDataSink bodyDataSink = exchange.forward(new HttpRequestHeader("POST", exchange.getRequest().getRequestUrl().toString()), respHdl);
        bodyDataSink.write("Hel");
        QAUtil.sleep(200);
        bodyDataSink.write("lo");
        bodyDataSink.close();
      }
View Full Code Here

      FileChannel fc = raf.getChannel();
 
      int size = (int) fc.size();
     
    FutureResponseHandler hdl = new FutureResponseHandler();
    BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/", "text/plain"), size, hdl);
   
    if (bodyDataSink.getFlushmode() != FlushMode.SYNC) {
      System.out.println("flush mode is not sync");
      Assert.fail("flush mode is not sync");
    }
View Full Code Here

         
        };
       
       
       
        BodyDataSink bodyDataSink = exchange.forward(new HttpRequestHeader("POST", exchange.getRequest().getRequestUrl().toString()), respHdl);
        bodyDataSink.write("Hel");
        QAUtil.sleep(200);
       
        bodyDataSink.write("lo");
        bodyDataSink.close();
View Full Code Here

      FileChannel fc = raf.getChannel();
 
      int size = (int) fc.size();
     
    FutureResponseHandler hdl = new FutureResponseHandler();
    BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/", "text/plain"), size, hdl);
   
    if (bodyDataSink.getFlushmode() != FlushMode.SYNC) {
      System.out.println("flush mode is not sync");
      Assert.fail("flush mode is not sync");
    }
View Full Code Here

    server.start();
   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
   
    FutureResponseHandler respHdl = new FutureResponseHandler();
    BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/"), 100, respHdl);
    bodyDataSink.write(QAUtil.generateByteArray(100));
    bodyDataSink.close();
   
    IHttpResponse response = respHdl.getResponse();
    Assert.assertEquals(200, response.getStatus());
View Full Code Here

    server.start();
   
    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
   
    FutureResponseHandler respHdl = new FutureResponseHandler();
    BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/"), respHdl);
    bodyDataSink.write(QAUtil.generateByteArray(100));
    bodyDataSink.close();
   
    IHttpResponse response = respHdl.getResponse();
    Assert.assertEquals(200, response.getStatus());
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

TOP

Related Classes of org.xlightweb.HttpRequestHeader

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.