@Test
public void testNestedUserQueueSpecificRule() throws Exception {

  // This test covers the use case where users can specify different parent
  // queues and want user queues under those.
  StringBuffer sb = new StringBuffer();
  sb.append("<queuePlacementPolicy>");
  sb.append("  <rule name='nestedUserQueue'>");
  sb.append("       <rule name='specified' create='false'/>");
  sb.append("  </rule>");
  sb.append("  <rule name='default' />");
  sb.append("</queuePlacementPolicy>");
  // Let's create couple of parent queues
  configuredQueues.get(FSQueueType.PARENT).add("root.parent1");
  configuredQueues.get(FSQueueType.PARENT).add("root.parent2");
  QueuePlacementPolicy policy = parse(sb.toString());
  assertEquals("root.parent1.user1",
      policy.assignAppToQueue("root.parent1", "user1"));
  assertEquals("root.parent2.user2",
      policy.assignAppToQueue("root.parent2", "user2"));
}