public void convertQueueHierarchy(FSQueue queue) {
    List<FSQueue> children = queue.getChildQueues();
    final String queueName = queue.getName();

    emitChildQueues(queueName, children);
    emitMaxAMShare(queueName, queue);
    emitMaxParallelApps(queueName, queue);
    emitMaxAllocations(queueName, queue);
    emitPreemptionDisabled(queueName, queue);

    emitChildCapacity(queue);
    emitMaximumCapacity(queueName, queue);
    emitSizeBasedWeight(queueName);
    emitOrderingPolicy(queueName, queue);
    checkMaxChildCapacitySetting(queue);
    emitDefaultUserLimitFactor(queueName, children);

    for (FSQueue childQueue : children) {
      convertQueueHierarchy(childQueue);
    }
  }
@Test
  public void testConvertQueueHierarchy() {
    converter = builder.build();

    converter.convertQueueHierarchy(rootQueue);

    // root children
    assertEquals("root children", Arrays.asList("admins", "users", "misc", "default"),
        csConfig.getQueues(ROOT));

    // root.admins children
    assertEquals("root.admins children", Arrays.asList("bob", "alice"),
        csConfig.getQueues(ADMINS));

    // root.default children - none
    assertTrue("root.default children",
        csConfig.getQueues(DEFAULT).isEmpty());

    // root.users children
    assertEquals("root.users children", Arrays.asList("john", "joe"),
        csConfig.getQueues(USERS));

    Set<String> leafs = Sets.difference(ALL_QUEUES,
        Sets.newHashSet("root",
            "root.default",
            "root.admins",
            "root.users",
            "root.misc"));

    for (String queue : leafs) {
      key = PREFIX + queue + ".queues";
      assertTrue("Key " + key + " has value, but it should be empty",
          csConfig.getQueues(new QueuePath(queue)).isEmpty());
    }

  }