### Question:
ServerWebApp extends Server implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } } protected  ServerWebApp(String name, String homeDir, String configDir, String logDir, String tempDir,
                         Configuration config); protected  ServerWebApp(String name, String homeDir, Configuration config);  ServerWebApp(String name); static void setHomeDirForCurrentThread(String homeDir); void contextInitialized(ServletContextEvent event); void contextDestroyed(ServletContextEvent event); InetSocketAddress getAuthority(); @VisibleForTesting void setAuthority(InetSocketAddress authority);  }### Answer:
@Test(expected = RuntimeException.class) @TestDir public void failedInit() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); System.setProperty("TestServerWebApp2.home.dir", dir); System.setProperty("TestServerWebApp2.config.dir", dir); System.setProperty("TestServerWebApp2.log.dir", dir); System.setProperty("TestServerWebApp2.temp.dir", dir); System.setProperty("testserverwebapp2.services", "FOO"); ServerWebApp server = new ServerWebApp("TestServerWebApp2") { }; server.contextInitialized(null); }