public virtual void SetUp() { clock = Org.Mockito.Mockito.Mock <Clock>(); plan = Org.Mockito.Mockito.Mock <Plan>(); rSystem = Org.Mockito.Mockito.Mock <ReservationSystem>(); plans[PlanName] = plan; rrValidator = new ReservationInputValidator(clock); Org.Mockito.Mockito.When(clock.GetTime()).ThenReturn(1L); ResourceCalculator rCalc = new DefaultResourceCalculator(); Org.Apache.Hadoop.Yarn.Api.Records.Resource resource = Org.Apache.Hadoop.Yarn.Api.Records.Resource .NewInstance(10240, 10); Org.Mockito.Mockito.When(plan.GetResourceCalculator()).ThenReturn(rCalc); Org.Mockito.Mockito.When(plan.GetTotalCapacity()).ThenReturn(resource); Org.Mockito.Mockito.When(rSystem.GetQueueForReservation(Matchers.Any <ReservationId >())).ThenReturn(PlanName); Org.Mockito.Mockito.When(rSystem.GetPlan(PlanName)).ThenReturn(plan); }
public virtual void TearDown() { rrValidator = null; clock = null; plan = null; }