/// <exception cref="System.IO.IOException"/> public virtual CapacityScheduler MockCapacityScheduler(int numContainers) { // stolen from TestCapacityScheduler CapacitySchedulerConfiguration conf = new CapacitySchedulerConfiguration(); SetupQueueConfiguration(conf); CapacityScheduler cs = Org.Mockito.Mockito.Spy(new CapacityScheduler()); cs.SetConf(new YarnConfiguration()); RMContext mockRmContext = CreateRMContext(conf); cs.SetRMContext(mockRmContext); try { cs.ServiceInit(conf); } catch (Exception e) { NUnit.Framework.Assert.Fail(e.Message); } InitializeRMContext(numContainers, cs, mockRmContext); return(cs); }