/** * Test {@link TaskAttemptStartedEvent} for various task types. */ private static void testAttemptStartedEventForTypes(EventType expected, TaskAttemptID id, TaskType[] types) { for (TaskType t : types) { TaskAttemptStartedEvent tase = new TaskAttemptStartedEvent(id, t, 0L, "", 0); assertEquals(expected, tase.getEventType()); } }
/** * Test {@link TaskAttemptUnsuccessfulCompletionEvent} for various task types. */ private static void testFailedKilledEventsForTypes(EventType expected, TaskAttemptID id, TaskType[] types, String state) { for (TaskType t : types) { TaskAttemptUnsuccessfulCompletionEvent tauce = new TaskAttemptUnsuccessfulCompletionEvent(id, t, state, 0L, "", ""); assertEquals(expected, tauce.getEventType()); } }
/** * Test {@link TaskAttemptFinishedEvent} for various task types. */ private static void testFinishedEventsForTypes(EventType expected, TaskAttemptID id, TaskType[] types) { for (TaskType t : types) { TaskAttemptFinishedEvent tafe = new TaskAttemptFinishedEvent(id, t, TaskStatus.State.SUCCEEDED.toString(), 0L, "", "", new Counters()); assertEquals(expected, tafe.getEventType()); } }