@Test
public void testTaskStartTimes() {
TaskId taskId = Mockito.mock(TaskId.class);
TaskInfo taskInfo = Mockito.mock(TaskInfo.class);
Map<TaskAttemptID, TaskAttemptInfo> taskAttempts
= new TreeMap<TaskAttemptID, TaskAttemptInfo>();
TaskAttemptID id = new TaskAttemptID("0", 0, TaskType.MAP, 0, 0);
TaskAttemptInfo info = Mockito.mock(TaskAttemptInfo.class);
Mockito.when(info.getAttemptId()).thenReturn(id);
Mockito.when(info.getStartTime()).thenReturn(10l);
taskAttempts.put(id, info);
id = new TaskAttemptID("1", 0, TaskType.MAP, 1, 1);
info = Mockito.mock(TaskAttemptInfo.class);
Mockito.when(info.getAttemptId()).thenReturn(id);
Mockito.when(info.getStartTime()).thenReturn(20l);
taskAttempts.put(id, info);
Mockito.when(taskInfo.getAllTaskAttempts()).thenReturn(taskAttempts);
CompletedTask task = new CompletedTask(taskId, taskInfo);
TaskReport report = task.getReport();
// Make sure the startTime returned by report is the lesser of the
// attempy launch times