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 testChildCapacityInWeightMode() {
    converter = builder.withPercentages(false).build();

    converter.convertQueueHierarchy(rootQueue);

    // root
    assertEquals("root.default weight", 1.0f,
        csConfig.getNonLabeledQueueWeight(DEFAULT), 0.01f);
    assertEquals("root.admins weight", 1.0f,
        csConfig.getNonLabeledQueueWeight(ADMINS), 0.01f);
    assertEquals("root.users weight", 1.0f,
        csConfig.getNonLabeledQueueWeight(USERS), 0.01f);

    // root.users
    assertEquals("root.users.john weight", 1.0f,
        csConfig.getNonLabeledQueueWeight(USERS_JOHN), 0.01f);
    assertEquals("root.users.joe weight", 3.0f,
        csConfig.getNonLabeledQueueWeight(USERS_JOE), 0.01f);

    // root.admins
    assertEquals("root.admins.alice weight", 3.0f,
        csConfig.getNonLabeledQueueWeight(ADMINS_ALICE), 0.01f);
    assertEquals("root.admins.bob weight", 1.0f,
        csConfig.getNonLabeledQueueWeight(ADMINS_BOB), 0.01f);

    // root.misc
    assertEquals("root.misc weight", 0.0f,
        csConfig.getNonLabeledQueueWeight(MISC), 0.00f);
    assertEquals("root.misc.a weight", 0.0f,
        csConfig.getNonLabeledQueueWeight(MISC_A), 0.00f);
    assertEquals("root.misc.b weight", 0.0f,
        csConfig.getNonLabeledQueueWeight(MISC_B), 0.00f);
  }