ApplicationHistoryManagerOnTimelineStore extends AbstractService implements
    ApplicationHistoryManager { @Override public ApplicationAttemptReport getApplicationAttempt( ApplicationAttemptId appAttemptId) throws YarnException, IOException { return getApplicationAttempt(appAttemptId, true); } ApplicationHistoryManagerOnTimelineStore(
      TimelineDataManager timelineDataManager,
      ApplicationACLsManager aclsManager); @Override ApplicationReport getApplication(ApplicationId appId); @Override Map<ApplicationId, ApplicationReport> getApplications(long appsNum,
      long appStartedTimeBegin, long appStartedTimeEnd); @Override Map<ApplicationAttemptId, ApplicationAttemptReport> getApplicationAttempts(ApplicationId appId); @Override ApplicationAttemptReport getApplicationAttempt(
      ApplicationAttemptId appAttemptId); @Override ContainerReport getContainer(ContainerId containerId); @Override ContainerReport getAMContainer(ApplicationAttemptId appAttemptId); @Override Map<ContainerId, ContainerReport> getContainers(
      ApplicationAttemptId appAttemptId);  }
@Test public void testGetApplicationAttemptReport() throws Exception { final ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1); ApplicationAttemptReport appAttempt; if (callerUGI == null) { appAttempt = historyManager.getApplicationAttempt(appAttemptId); } else { try { appAttempt = callerUGI.doAs(new PrivilegedExceptionAction<ApplicationAttemptReport> () { @Override public ApplicationAttemptReport run() throws Exception { return historyManager.getApplicationAttempt(appAttemptId); } }); if (callerUGI != null && callerUGI.getShortUserName().equals("user3")) { Assert.fail(); } } catch (AuthorizationException e) { if (callerUGI != null && callerUGI.getShortUserName().equals("user3")) { return; } throw e; } } Assert.assertNotNull(appAttempt); Assert.assertEquals(appAttemptId, appAttempt.getApplicationAttemptId()); Assert.assertEquals(ContainerId.newContainerId(appAttemptId, 1), appAttempt.getAMContainerId()); Assert.assertEquals("test host", appAttempt.getHost()); Assert.assertEquals(100, appAttempt.getRpcPort()); Assert.assertEquals("test tracking url", appAttempt.getTrackingUrl()); Assert.assertEquals("test original tracking url", appAttempt.getOriginalTrackingUrl()); Assert.assertEquals("test diagnostics info", appAttempt.getDiagnostics()); Assert.assertEquals(YarnApplicationAttemptState.FINISHED, appAttempt.getYarnApplicationAttemptState()); }