@Test
public void testInitialize() {

  ReservationSystemTestUtil testUtil = new ReservationSystemTestUtil();
  CapacityScheduler capScheduler = null;
  try {
    capScheduler = testUtil.mockCapacityScheduler(10);
  } catch (IOException e) {
    Assert.fail(e.getMessage());
  }
  CapacityReservationSystem reservationSystem =
      new CapacityReservationSystem();
  reservationSystem.setRMContext(capScheduler.getRMContext());
  try {
    reservationSystem.reinitialize(capScheduler.getConf(),
        capScheduler.getRMContext());
  } catch (YarnException e) {
    Assert.fail(e.getMessage());
  }
  String planQName = testUtil.getreservationQueueName();
  Plan plan = reservationSystem.getPlan(planQName);
  Assert.assertNotNull(plan);
  Assert.assertTrue(plan instanceof InMemoryPlan);
  Assert.assertEquals(planQName, plan.getQueueName());
  Assert.assertEquals(8192, plan.getTotalCapacity().getMemory());
  Assert
      .assertTrue(plan.getReservationAgent() instanceof GreedyReservationAgent);
  Assert
      .assertTrue(plan.getSharingPolicy() instanceof CapacityOverTimePolicy);
}