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

    converter.convertQueueHierarchy(rootQueue);

    // root.admins.bob
    assertEquals("root.admins.bob AM share", 1.0f,
        csConfig.getMaximumApplicationMasterResourcePerQueuePercent(
            ADMINS_BOB), 0.0f);

    // root.admins.alice
    assertEquals("root.admins.alice AM share", 0.15f,
        csConfig.getMaximumApplicationMasterResourcePerQueuePercent(
            ADMINS_ALICE), 0.0f);

    Set<String> remaining = Sets.difference(ALL_QUEUES,
        Sets.newHashSet("root.admins.bob", "root.admins.alice"));

    for (String queue : remaining) {
      key = PREFIX + queue + ".maximum-am-resource-percent";
      assertEquals("Key " + key + " has different value",
          0.1f, csConfig
              .getMaximumApplicationMasterResourcePerQueuePercent(new QueuePath(queue)), 0.0f);
    }
  }