@Test
  public void testMissingServerResource() throws Throwable {
    try {
      HttpServer server = createServer("NoSuchWebapp");
      // should not have got here.
      // close the server
      String serverDescription = server.toString();
      stop(server);
      fail("Expected an exception, got " + serverDescription);
    } catch (FileNotFoundException expected) {
      log.debug("Expected exception " + expected, expected);
    }
  }
Test that an invalid webapp triggers an exception
@throws Throwable if something went wrong
hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServerWebapps.java