use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager in project hadoop by apache.
the class TestAHSWebApp method testAppControllerIndex.
@Test
public void testAppControllerIndex() throws Exception {
ApplicationHistoryManager ahManager = mock(ApplicationHistoryManager.class);
Injector injector = WebAppTests.createMockInjector(ApplicationHistoryManager.class, ahManager);
AHSController controller = injector.getInstance(AHSController.class);
controller.index();
Assert.assertEquals("Application History", controller.get(TITLE, "unknown"));
}
use of org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager in project hadoop by apache.
the class TestAHSWebApp method mockApplicationHistoryClientService.
ApplicationHistoryClientService mockApplicationHistoryClientService(int numApps, int numAppAttempts, int numContainers) throws Exception {
ApplicationHistoryManager ahManager = new MockApplicationHistoryManagerImpl(store);
ApplicationHistoryClientService historyClientService = new ApplicationHistoryClientService(ahManager);
for (int i = 1; i <= numApps; ++i) {
ApplicationId appId = ApplicationId.newInstance(0, i);
writeApplicationStartData(appId);
for (int j = 1; j <= numAppAttempts; ++j) {
ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, j);
writeApplicationAttemptStartData(appAttemptId);
for (int k = 1; k <= numContainers; ++k) {
ContainerId containerId = ContainerId.newContainerId(appAttemptId, k);
writeContainerStartData(containerId);
writeContainerFinishData(containerId);
}
writeApplicationAttemptFinishData(appAttemptId);
}
writeApplicationFinishData(appId);
}
return historyClientService;
}
Aggregations