Thread.currentThread().sleep(10000L);
HandlerCollection hcollection = (HandlerCollection) server.getChildHandlerByClass(HandlerCollection.class); assertNotNull("Should have a HandlerCollection", hcollection); assertNotNull("HandlerCollection should contain handlers", hcollection.getHandlers()); Handler[] handlers = hcollection.getHandlers(); assertEquals("Should be 3 handlers", 3,handlers.length); assertTrue("First handler should be a ContextHandlerCollection", handlers[0] instanceof ContextHandlerCollection); Handler[] webapps = ((ContextHandlerCollection)handlers[0]).getChildHandlers(); assertNotNull("Should be at least one webapp", webapps); assertTrue("Should be an instance of WebAppContext", webapps[0] instanceof WebAppContext);
    public void testUsingXBeanXmlConfig() throws Exception {        URL url = getClass().getClassLoader().getResource("org/mortbay/jetty/xbean/xbean.xml");        assertNotNull("Could not find xbean.xml on the classpath!", url);                context = new ResourceXmlApplicationContext(new UrlResource(url));         String[] names = context.getBeanNamesForType(Server.class);        assertEquals("Should have the name of a Jetty server", 1, names.length);        Server server = (Server) context.getBean(names[0]);        assertNotNull("Should have a Jetty Server", server);        Thread.currentThread().sleep(10000L);    }