Package org.xsocket.connection

Examples of org.xsocket.connection.Server


       
        return true;
      }
    };
   
    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();
    server.close();
  }
View Full Code Here


       
        return true;
      }
    };
   
    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();
    server.close();
  }
View Full Code Here

       
        return true;
      }
    };
   
    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();
    server.close();
  }
View Full Code Here

       
        return true;
      }
    };
   
    IServer server = new Server(hdl);
    server.start();

    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
    IHttpResponse response = con.call(new GetRequest("/"));
   
    String body = response.getBlockingBody().readString();
   
    Assert.assertEquals(200, response.getStatus());
    Assert.assertTrue(response.getContentType() == null);
    Assert.assertEquals("<html> <body>this is a plain body </body></html>", body);
   
    con.close();
    server.close();
  }
View Full Code Here

               
                return true;
            }
        };
       
        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());
       
        con.close();
        server.close();
    }
View Full Code Here

               
                return true;
            }
        };
       
        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());
       
        con.close();
        server.close();
    }   
View Full Code Here

       
        return true;
      }
    };
   
    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());
   
    con.close();
    server.close();
  }
View Full Code Here

       
        return true;
      }
    };
   
    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"));
   
    con.close();
    server.close();
  }
View Full Code Here

       
        return true;
      }
    };
   
    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());
   
    con.close();
    server.close();
  }
View Full Code Here

       
        return true;
      }
    };
   
    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());
   
    con.close();
    server.close();
  }
View Full Code Here

TOP

Related Classes of org.xsocket.connection.Server

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.