Package org.xlightweb.server

Examples of org.xlightweb.server.HttpServer.start()


  @Ignore
  @Test
  public void testApacheClientPooledWebServer() throws Exception {
   
    final HttpServer server = new HttpServer(new RequestHandler());
    server.start();
   
 
    for (int i =0; i < 5; i++) {
      new Thread() {
        @Override
View Full Code Here


  @Ignore
  @Test
  public void testPooledWebServer() throws Exception {
   
    final HttpServer server = new HttpServer(new RequestHandler());
    server.start();
   
 
    for (int i =0; i < 5; i++) {
      new Thread() {
        @Override
View Full Code Here

  public void testApacheClientPooledWebServer() throws Exception {
   
    System.out.println("testApacheClientPooledWebServer");
   
    final HttpServer server = new HttpServer(new RequestHandler());
    server.start();
   
 
    for (int i =0; i < 3; i++) {
      new Thread() {
        @Override
View Full Code Here

    @Ignore
  @Test
  public void testPooledWebServer() throws Exception {
   
    final HttpServer server = new HttpServer(new RequestHandler());
    server.start();
   
 
    for (int i =0; i < 3; i++) {
      new Thread() {
        @Override
View Full Code Here

 
 
  @Test
  public void testRewriteCookie() throws Exception {
      HttpServer server = new HttpServer(new RequestHandler());
      server.start();
     
      HttpClient httpClient = new HttpClient();
     
      GetRequest request = new GetRequest("http://localhost:" + server.getLocalPort() + "/test");
      IHttpResponse response = httpClient.call(request);
View Full Code Here

   
    @Test
    public void testWebSockets() throws Exception {
       
        HttpServer server = new HttpServer(new DualHandler());
        server.start();
       
        HttpClient httpClient = new HttpClient();
       
        IWebSocketConnection webSocketConnection = httpClient.openWebSocketConnection("ws://localhost:" +  server.getLocalPort());
       
View Full Code Here

    @Test
    public void testSSE() throws Exception {
       
        HttpServer server = new HttpServer(new DualHandler());
        server.start();
       
       
        HttpClient httpClient = new HttpClient();
       
        IEventDataSource eventSource = httpClient.openEventDataSource("http://localhost:" +  server.getLocalPort() + "/", false);
View Full Code Here

 
  @Test
  public void testLocal() throws Exception {
   
    IServer server = new HttpServer(new RequestHandler());
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
    BodyDataSource body = resp.getBody();
   
View Full Code Here

                ds.write(new Event("second event", "1").toString());
            }
        };
       
        HttpServer server = new HttpServer(hdl);
        server.start();
       
       
        HttpClient client = new HttpClient();
       
        GetRequest request = new GetRequest("http://localhost:" + server.getLocalPort() + "/Events");
View Full Code Here

                exchange.send(resp);
            }
        };
       
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
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.