Package org.xlightweb.server

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


    @Test
    public void testManualContinue() throws Exception {

        ContinueHandler hdl = new ContinueHandler();
        HttpServer server = new HttpServer(hdl);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here


    @Test
    public void testManualContinue2() throws Exception {

        ContinueHandler2 hdl = new ContinueHandler2();
        HttpServer server = new HttpServer(hdl);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

                exchange.send(new HttpResponse(200, "text/plain", "OK"));
            }
        };

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

            }
        };
       
       
        HttpServer server = new HttpServer(hdl);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

    public void testApacheClient() throws Exception {
       
     
        ContinueHandler hdl = new ContinueHandler();
        HttpServer server = new HttpServer(hdl);
        server.start();


        HttpClient httpClient = new HttpClient();
        httpClient.getParams().setParameter("http.protocol.expect-continue", true);
View Full Code Here

    @Test
    public void testManualContinueWithMissingAnnotation() throws Exception {

        MissingAnnotationContinueHandler hdl = new MissingAnnotationContinueHandler();
        HttpServer server = new HttpServer(hdl);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

        RequestHandlerChain chain = new RequestHandlerChain();
        chain.addLast(interceptor);
        chain.addLast(new ItWorksHandler());
       
        HttpServer server = new HttpServer(chain);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

        outerChain.addLast(interceptor2);
        outerChain.addLast(chain);
       
       
        HttpServer server = new HttpServer(outerChain);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

        outerChain.addLast(interceptor2);
        outerChain.addLast(chain);
       
       
        HttpServer server = new HttpServer(outerChain);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

        outerChain.addLast(interceptor2);
        outerChain.addLast(chain);
       
       
        HttpServer server = new HttpServer(outerChain);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\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.