public void testDetection() throws Exception {
// second, we test the actual effect of the flag on the startup
StuckingServlet stuckingServlet = new StuckingServlet(6000L);
Wrapper servlet = Tomcat.addServlet(context, "myservlet",
stuckingServlet);
servlet.addMapping("/myservlet");
StuckThreadDetectionValve valve = new StuckThreadDetectionValve();
valve.setThreshold(2);
context.addValve(valve);
context.setBackgroundProcessorDelay(1);