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

    converter.convertQueueHierarchy(rootQueue);

    // root
    assertEquals("root.default capacity", 33.333f,
        csConfig.getNonLabeledQueueCapacity(DEFAULT), 0.0f);
    assertEquals("root.admins capacity", 33.333f,
        csConfig.getNonLabeledQueueCapacity(ADMINS), 0.0f);
    assertEquals("root.users capacity", 33.334f,
        csConfig.getNonLabeledQueueCapacity(USERS), 0.0f);

    // root.users
    assertEquals("root.users.john capacity", 25.000f,
        csConfig.getNonLabeledQueueCapacity(USERS_JOHN), 0.0f);
    assertEquals("root.users.joe capacity", 75.000f,
         csConfig.getNonLabeledQueueCapacity(USERS_JOE), 0.0f);

    // root.admins
    assertEquals("root.admins.alice capacity", 75.000f,
        csConfig.getNonLabeledQueueCapacity(ADMINS_ALICE), 0.0f);
    assertEquals("root.admins.bob capacity", 25.000f,
        csConfig.getNonLabeledQueueCapacity(ADMINS_BOB), 0.0f);

    // root.misc
    assertEquals("root.misc capacity", 0.000f,
        csConfig.getNonLabeledQueueCapacity(MISC), 0.000f);
    assertEquals("root.misc.a capacity", 0.000f,
        csConfig.getNonLabeledQueueCapacity(MISC_A), 0.000f);
    assertEquals("root.misc.b capacity", 0.000f,
        csConfig.getNonLabeledQueueCapacity(MISC_B), 0.000f);
  }