/// <summary>test some methods of CompletedTaskAttempt</summary> public virtual void TestCompletedTaskAttempt() { JobHistoryParser.TaskAttemptInfo attemptInfo = Org.Mockito.Mockito.Mock <JobHistoryParser.TaskAttemptInfo >(); Org.Mockito.Mockito.When(attemptInfo.GetRackname()).ThenReturn("Rackname"); Org.Mockito.Mockito.When(attemptInfo.GetShuffleFinishTime()).ThenReturn(11L); Org.Mockito.Mockito.When(attemptInfo.GetSortFinishTime()).ThenReturn(12L); Org.Mockito.Mockito.When(attemptInfo.GetShufflePort()).ThenReturn(10); JobID jobId = new JobID("12345", 0); TaskID taskId = new TaskID(jobId, TaskType.Reduce, 0); TaskAttemptID taskAttemptId = new TaskAttemptID(taskId, 0); Org.Mockito.Mockito.When(attemptInfo.GetAttemptId()).ThenReturn(taskAttemptId); CompletedTaskAttempt taskAttemt = new CompletedTaskAttempt(null, attemptInfo); NUnit.Framework.Assert.AreEqual("Rackname", taskAttemt.GetNodeRackName()); NUnit.Framework.Assert.AreEqual(Phase.Cleanup, taskAttemt.GetPhase()); NUnit.Framework.Assert.IsTrue(taskAttemt.IsFinished()); NUnit.Framework.Assert.AreEqual(11L, taskAttemt.GetShuffleFinishTime()); NUnit.Framework.Assert.AreEqual(12L, taskAttemt.GetSortFinishTime()); NUnit.Framework.Assert.AreEqual(10, taskAttemt.GetShufflePort()); }
public virtual long GetShuffleFinishTime() { return(attemptInfo.GetShuffleFinishTime()); }