Search in sources :

Example 1 with ApplicationReportPBImpl

use of org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl in project hadoop by apache.

the class TestRemoteAppChecker method testRunningApp.

@Test
public void testRunningApp() throws Exception {
    YarnClient client = createCheckerWithMockedClient();
    ApplicationId id = ApplicationId.newInstance(1, 1);
    // create a report and set the state to an active one
    ApplicationReport report = new ApplicationReportPBImpl();
    report.setYarnApplicationState(YarnApplicationState.ACCEPTED);
    doReturn(report).when(client).getApplicationReport(id);
    assertTrue(checker.isApplicationActive(id));
}
Also used : ApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationReport) ApplicationReportPBImpl(org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl) ApplicationId(org.apache.hadoop.yarn.api.records.ApplicationId) YarnClient(org.apache.hadoop.yarn.client.api.YarnClient) Test(org.junit.Test)

Aggregations

ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 ApplicationReport (org.apache.hadoop.yarn.api.records.ApplicationReport)1 ApplicationReportPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl)1 YarnClient (org.apache.hadoop.yarn.client.api.YarnClient)1 Test (org.junit.Test)1