Package winstone

Examples of winstone.Launcher


        args.put("ajp13Port", "-1");
        args.put("controlPort", "-1");
        args.put("debug", "8");
        args.put("logThrowingLineNo", "true");
        Logger.init(Logger.FULL_DEBUG, System.out, true);
        Launcher winstone = new Launcher(args);

        // Check for a simple connection
        WebConversation wc = new WebConversation();
        WebRequest wreq = new GetMethodWebRequest(
                "http://localhost:10003/examples/CountRequestsServlet");
        WebResponse wresp = wc.getResponse(wreq);
        InputStream content = wresp.getInputStream();
        assertTrue("Loading CountRequestsServlet", content.available() > 0);
        content.close();
        winstone.shutdown();
        Thread.sleep(500);
    }
View Full Code Here


        args.put("ajp13Port", "-1");
        args.put("controlPort", "-1");
        args.put("debug", "8");
        args.put("logThrowingLineNo", "true");
        Logger.init(Logger.FULL_DEBUG, System.out, true);
        Launcher winstone = new Launcher(args);

        // Check for a simple connection
        WebConversation wc = new WebConversation();
        WebRequest wreq = new GetMethodWebRequest(
                "http://localhost:10004/examples/CountRequestsServlet");
        WebResponse wresp1 = wc.getResponse(wreq);
        WebImage img[] = wresp1.getImages();
        for (int n = 0; n < img.length; n++)
            wc.getResponse(img[n].getRequest());
        // Thread.sleep(2000);
        // WebResponse wresp2 = wc.getResponse(wreq);
        // Thread.sleep(2000);
        //WebResponse wresp3 = wc.getResponse(wreq);
        InputStream content = wresp1.getInputStream();
        assertTrue("Loading CountRequestsServlet + child images", content
                .available() > 0);
        content.close();
        winstone.shutdown();
        Thread.sleep(500);
    }
View Full Code Here

        args.put("ajp13Port", "-1");
        args.put("controlPort", "-1");
        args.put("debug", "8");
        args.put("logThrowingLineNo", "true");
        Logger.init(Logger.FULL_DEBUG, System.out, true);
        Launcher winstone = new Launcher(args);

        // Check for a simple connection
        WebConversation wc = new WebConversation();
        WebRequest wreq = new GetMethodWebRequest(
                "http://localhost:10005/examples/TestWriteAfterServlet");
        WebResponse wresp1 = wc.getResponse(wreq);
        Logger.logDirectMessage(Logger.INFO, "log", "Output: " + wresp1.getText(), null);
        assertTrue(wresp1.getText().endsWith("Hello"));
        winstone.shutdown();
        Thread.sleep(500);
    }
View Full Code Here

      args.put("webroot", outputDirectory.getAbsolutePath());
      args.put("httpPort", port.toString());
      args.put("httpListenAddress", listenAddress);

      launcher = new Launcher(args);
    } catch (Exception exc) {
      throw new MojoExecutionException("Ooops", exc);
    }
  }
View Full Code Here

        try {
            HashMap<String, String> params = new HashMap<String, String>();
            params.put("webroot", "src/main/webapp"); // or any other command line
            // args, eg port
            Launcher.initLogger(params);
            new Launcher(params); // spawns threads (not daemon), so your application doesn't block
        } catch (Exception exc) {
            exc.printStackTrace();
            System.exit(100);
        }
    }
View Full Code Here

TOP

Related Classes of winstone.Launcher

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.