@Test
  public void testWepAppContextAfterServerStop() throws Throwable {
    String key = "test.attribute.key";
    String value = "test.attribute.value";
    HttpServer server = createTestServer();
    assertNotLive(server);
    server.start();
    server.setAttribute(key, value);
    assertAlive(server);
    assertEquals(value, server.getAttribute(key));
    stop(server);
    assertNull("Server context should have cleared", server.getAttribute(key));
  }
Test that the server is alive once started
hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServerLifecycle.java