/// <exception cref="System.IO.IOException"/>
        private static FairScheduler MockFairScheduler()
        {
            FairScheduler fs = new FairScheduler();
            FairSchedulerConfiguration conf = new FairSchedulerConfiguration();

            fs.SetRMContext(new RMContextImpl(null, null, null, null, null, null, new RMContainerTokenSecretManager
                                                  (conf), new NMTokenSecretManagerInRM(conf), new ClientToAMTokenSecretManagerInRM
                                                  (), null));
            fs.Init(conf);
            return(fs);
        }
        /// <exception cref="System.IO.IOException"/>
        public static FairScheduler SetupFairScheduler(ReservationSystemTestUtil testUtil
                                                       , RMContext rmContext, Configuration conf, int numContainers)
        {
            FairScheduler scheduler = new FairScheduler();

            scheduler.SetRMContext(rmContext);
            Org.Mockito.Mockito.When(rmContext.GetScheduler()).ThenReturn(scheduler);
            scheduler.Init(conf);
            scheduler.Start();
            scheduler.Reinitialize(conf, rmContext);
            Resource resource = ReservationSystemTestUtil.CalculateClusterResource(numContainers
                                                                                   );
            RMNode node1 = MockNodes.NewNodeInfo(1, resource, 1, "127.0.0.1");
            NodeAddedSchedulerEvent nodeEvent1 = new NodeAddedSchedulerEvent(node1);

            scheduler.Handle(nodeEvent1);
            return(scheduler);
        }