List of usage examples for org.apache.hadoop.yarn.api.records YarnApplicationAttemptState FAILED
YarnApplicationAttemptState FAILED
To view the source code for org.apache.hadoop.yarn.api.records YarnApplicationAttemptState FAILED.
Click Source Link
From source file:org.apache.samza.validation.TestYarnJobValidationTool.java
License:Apache License
@Test public void testValidateRunningAttemptId() throws Exception { ApplicationReport appReport = mock(ApplicationReport.class); when(client.getApplicationReport(appId)).thenReturn(appReport); when(appReport.getCurrentApplicationAttemptId()).thenReturn(attemptId); ApplicationAttemptReport attemptReport = mock(ApplicationAttemptReport.class); when(attemptReport.getYarnApplicationAttemptState()).thenReturn(YarnApplicationAttemptState.RUNNING); when(attemptReport.getApplicationAttemptId()).thenReturn(attemptId); when(client.getApplicationAttemptReport(attemptId)).thenReturn(attemptReport); assertTrue(tool.validateRunningAttemptId(appId).equals(attemptId)); when(attemptReport.getYarnApplicationAttemptState()).thenReturn(YarnApplicationAttemptState.FAILED); exception.expect(SamzaException.class); tool.validateRunningAttemptId(appId); }