Package org.xsocket.connection

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


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

        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("GET /picture/?name= HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here


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

        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("GET /picture/?name=value&name2= HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

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

        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("GET /picture/?name=value& HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

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

        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("GET /picture/?blablabla HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

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

        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("GET /picture/?blablabla&werwer HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

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

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

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

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

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

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

  @Test
  public void testGodHttp11RequestWithQuery() 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=value2"));

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

  @Test
  public void testGodHttp11RequestWithQuery0() 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?test=12&test=two"));

    Assert.assertEquals(200, response.getStatus());
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.