@Test(timeout = 50000)
public void testStartStopServer() throws Exception {

  historyServer = new ApplicationHistoryServer();
  Configuration config = new YarnConfiguration();
  historyServer.init(config);
  assertEquals(STATE.INITED, historyServer.getServiceState());
  assertEquals(3, historyServer.getServices().size());
  ApplicationHistoryClientService historyService =
      historyServer.getClientService();
  assertNotNull(historyServer.getClientService());
  assertEquals(STATE.INITED, historyService.getServiceState());
  historyServer.start();
  assertEquals(STATE.STARTED, historyServer.getServiceState());
  assertEquals(STATE.STARTED, historyService.getServiceState());
  historyServer.stop();
  assertEquals(STATE.STOPPED, historyServer.getServiceState());
}