Example #1
0
        public virtual void TestCountersFromHistoryServer()
        {
            MRClientProtocol historyServerProxy = Org.Mockito.Mockito.Mock <MRClientProtocol>(
                );

            Org.Mockito.Mockito.When(historyServerProxy.GetCounters(GetCountersRequest())).ThenReturn
                (GetCountersResponseFromHistoryServer());
            ResourceMgrDelegate rm = Org.Mockito.Mockito.Mock <ResourceMgrDelegate>();

            Org.Mockito.Mockito.When(rm.GetApplicationReport(TypeConverter.ToYarn(oldJobId).GetAppId
                                                                 ())).ThenReturn(null);
            ClientServiceDelegate clientServiceDelegate = GetClientServiceDelegate(historyServerProxy
                                                                                   , rm);
            Counters counters = TypeConverter.ToYarn(clientServiceDelegate.GetJobCounters(oldJobId
                                                                                          ));

            NUnit.Framework.Assert.IsNotNull(counters);
            NUnit.Framework.Assert.AreEqual(1001, counters.GetCounterGroup("dummyCounters").GetCounter
                                                ("dummyCounter").GetValue());
        }