Package org.xsocket.connection

Examples of org.xsocket.connection.IServer.start()


  @Test
  public void testGodHttp11RequestWithQuery2() throws Exception {
   
    RequestHandler rh = new RequestHandler();
    IServer server = new HttpServer(rh);
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test/?param1=value1&param2="));

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


  @Test
  public void testGodHttp11RequestWithQuery3() throws Exception {
   
    RequestHandler rh = new RequestHandler();
    IServer server = new HttpServer(rh);
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test/?param1=value1"));

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

  @Test
  public void testGodHttp11RequestWithQuery4() throws Exception {
   
    RequestHandler rh = new RequestHandler();
    IServer server = new HttpServer(rh);
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test/?param1="));

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

  @Test
  public void testGodHttp11RequestWithQuery5() throws Exception {
   
    RequestHandler rh = new RequestHandler();
    IServer server = new HttpServer(rh);
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test?filename=C%3A%5CDOKUME%7E1%5Cgrro%5CLOKALE%7E1%5CTemp%5CxSocketTest23878.html"));

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

  @Test
  public void testGodHttp11RequestWithQuery6() throws Exception {
   
    RequestHandler rh = new RequestHandler();
    IServer server = new HttpServer(rh);
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test/?param1=&param2=2"));

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

  @Test
  public void testGodHttp11RequestWithQuery7() throws Exception {
   
    RequestHandler rh = new RequestHandler();
    IServer server = new HttpServer(rh);
    server.start();
   
    HttpClient httpClient = new HttpClient();
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test/?param1=&param2=2&param1=3"));

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

    @Test
    public void testGodHttp11RequestWithQuery8() throws Exception {
       
        RequestHandler rh = new RequestHandler();
        IServer server = new HttpServer(rh);
        server.start();
       
        HttpClient httpClient = new HttpClient();
       
        MultivalueMap entity = new MultivalueMap("UTF-8", new NameValuePair("param1", ""), new NameValuePair("param2", " 2  "), new NameValuePair("param1", "3 "));
        IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test/?" + entity.toString()));
View Full Code Here

 
  @Test
  public void testGodHttp10Request() throws Exception {
   
    IServer server = new HttpServer(new RequestHandler());
    server.start();
   

    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    con.write("GET / HTTP/1.0\r\n" +
          "\r\n");
View Full Code Here

 
  @Test
  public void testGodHttp10Request_2() throws Exception {
   
    IServer server = new HttpServer(new RequestHandler());
    server.start();
   

    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    con.write("GET / HTTP/1.0\n" +
          "\n");
View Full Code Here

  @Test
  public void testBadRequest() throws Exception {

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

    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    con.write("GET /s/ ere6r" + "\r\n\r\n");
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.