ApplicationHistoryClientService extends AbstractService implements
    ApplicationHistoryProtocol { @Override public GetApplicationAttemptReportResponse getApplicationAttemptReport( GetApplicationAttemptReportRequest request) throws YarnException, IOException { ApplicationAttemptId appAttemptId = request.getApplicationAttemptId(); try { GetApplicationAttemptReportResponse response = GetApplicationAttemptReportResponse.newInstance(history .getApplicationAttempt(appAttemptId)); return response; } catch (IOException e) { LOG.error(e.getMessage(), e); throw e; } } ApplicationHistoryClientService(ApplicationHistoryManager history); @Private InetSocketAddress getBindAddress(); @Override CancelDelegationTokenResponse cancelDelegationToken(
      CancelDelegationTokenRequest request); @Override GetApplicationAttemptReportResponse getApplicationAttemptReport(
      GetApplicationAttemptReportRequest request); @Override GetApplicationAttemptsResponse getApplicationAttempts(
      GetApplicationAttemptsRequest request); @Override GetApplicationReportResponse getApplicationReport(
      GetApplicationReportRequest request); @Override GetApplicationsResponse getApplications(GetApplicationsRequest request); @Override GetContainerReportResponse getContainerReport(
      GetContainerReportRequest request); @Override GetContainersResponse getContainers(GetContainersRequest request); @Override GetDelegationTokenResponse getDelegationToken(
      GetDelegationTokenRequest request); @Override RenewDelegationTokenResponse renewDelegationToken(
      RenewDelegationTokenRequest request);  }
@Test public void testApplicationAttemptNotFound() throws IOException, YarnException { ApplicationId appId = ApplicationId.newInstance(0, 1); ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, MAX_APPS + 1); GetApplicationAttemptReportRequest request = GetApplicationAttemptReportRequest.newInstance(appAttemptId); try { @SuppressWarnings("unused") GetApplicationAttemptReportResponse response = clientService.getApplicationAttemptReport(request); Assert.fail("Exception should have been thrown before we reach here."); } catch (ApplicationAttemptNotFoundException e) { System.out.println(e.getMessage()); Assert.assertTrue(e.getMessage().contains( "doesn't exist in the timeline store")); } catch (Exception e) { Assert.fail("Undesired exception caught"); } }
@Test public void testApplicationAttemptReport() throws IOException, YarnException { ApplicationId appId = ApplicationId.newInstance(0, 1); ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); GetApplicationAttemptReportRequest request = GetApplicationAttemptReportRequest.newInstance(appAttemptId); GetApplicationAttemptReportResponse response = clientService.getApplicationAttemptReport(request); ApplicationAttemptReport attemptReport = response.getApplicationAttemptReport(); Assert.assertNotNull(attemptReport); Assert.assertEquals("appattempt_0_0001_000001", attemptReport .getApplicationAttemptId().toString()); }