public virtual void TestReservableQueue() { Configuration conf = new Configuration(); conf.Set(FairSchedulerConfiguration.AllocationFile, AllocFile); PrintWriter @out = new PrintWriter(new FileWriter(AllocFile)); @out.WriteLine("<?xml version=\"1.0\"?>"); @out.WriteLine("<allocations>"); @out.WriteLine("<queue name=\"reservable\">"); @out.WriteLine("<reservation>"); @out.WriteLine("</reservation>"); @out.WriteLine("</queue>"); @out.WriteLine("<queue name=\"other\">"); @out.WriteLine("</queue>"); @out.WriteLine("<reservation-agent>DummyAgentName</reservation-agent>"); @out.WriteLine("<reservation-policy>AnyAdmissionPolicy</reservation-policy>"); @out.WriteLine("</allocations>"); @out.Close(); AllocationFileLoaderService allocLoader = new AllocationFileLoaderService(); allocLoader.Init(conf); TestAllocationFileLoaderService.ReloadListener confHolder = new TestAllocationFileLoaderService.ReloadListener (this); allocLoader.SetReloadListener(confHolder); allocLoader.ReloadAllocations(); AllocationConfiguration allocConf = confHolder.allocConf; string reservableQueueName = "root.reservable"; string nonreservableQueueName = "root.other"; NUnit.Framework.Assert.IsFalse(allocConf.IsReservable(nonreservableQueueName)); NUnit.Framework.Assert.IsTrue(allocConf.IsReservable(reservableQueueName)); NUnit.Framework.Assert.IsTrue(allocConf.GetMoveOnExpiry(reservableQueueName)); NUnit.Framework.Assert.AreEqual(ReservationSchedulerConfiguration.DefaultReservationWindow , allocConf.GetReservationWindow(reservableQueueName)); NUnit.Framework.Assert.AreEqual(100, allocConf.GetInstantaneousMaxCapacity(reservableQueueName ), 0.0001); NUnit.Framework.Assert.AreEqual("DummyAgentName", allocConf.GetReservationAgent(reservableQueueName )); NUnit.Framework.Assert.AreEqual(100, allocConf.GetAverageCapacity(reservableQueueName ), 0.001); NUnit.Framework.Assert.IsFalse(allocConf.GetShowReservationAsQueues(reservableQueueName )); NUnit.Framework.Assert.AreEqual("AnyAdmissionPolicy", allocConf.GetReservationAdmissionPolicy (reservableQueueName)); NUnit.Framework.Assert.AreEqual(ReservationSchedulerConfiguration.DefaultReservationPlannerName , allocConf.GetReplanner(reservableQueueName)); NUnit.Framework.Assert.AreEqual(ReservationSchedulerConfiguration.DefaultReservationEnforcementWindow , allocConf.GetEnforcementWindow(reservableQueueName)); }