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);
}