Esempio n. 1
0
        /// <summary>Simple test PartialJob</summary>
        /// <exception cref="System.Exception"/>
        public virtual void TestPartialJob()
        {
            JobId jobId = new JobIdPBImpl();

            jobId.SetId(0);
            JobIndexInfo jii = new JobIndexInfo(0L, Runtime.CurrentTimeMillis(), "user", "jobName"
                                                , jobId, 3, 2, "JobStatus");
            PartialJob test = new PartialJob(jii, jobId);

            NUnit.Framework.Assert.AreEqual(1.0f, test.GetProgress(), 0.001);
            NUnit.Framework.Assert.IsNull(test.GetAllCounters());
            NUnit.Framework.Assert.IsNull(test.GetTasks());
            NUnit.Framework.Assert.IsNull(test.GetTasks(TaskType.Map));
            NUnit.Framework.Assert.IsNull(test.GetTask(new TaskIdPBImpl()));
            NUnit.Framework.Assert.IsNull(test.GetTaskAttemptCompletionEvents(0, 100));
            NUnit.Framework.Assert.IsNull(test.GetMapAttemptCompletionEvents(0, 100));
            NUnit.Framework.Assert.IsTrue(test.CheckAccess(UserGroupInformation.GetCurrentUser
                                                               (), null));
            NUnit.Framework.Assert.IsNull(test.GetAMInfos());
        }