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 testQueueOrderingPolicy() throws Exception {
    converter = builder.build();
    String absolutePath =
        new File("src/test/resources/fair-scheduler-orderingpolicy.xml")
          .getAbsolutePath();
    yarnConfig.set(FairSchedulerConfiguration.ALLOCATION_FILE,
        FILE_PREFIX + absolutePath);
    fs.close();
    fs = createFairScheduler();
    rootQueue = fs.getQueueManager().getRootQueue();

    converter.convertQueueHierarchy(rootQueue);
    // root
    assertEquals("root ordering policy", "fifo",
        csConfig.getAppOrderingPolicy(ROOT).getConfigName());
    assertEquals("root.default ordering policy", "fair",
        csConfig.getAppOrderingPolicy(DEFAULT).getConfigName());
    assertEquals("root.admins ordering policy", "fifo",
        csConfig.getAppOrderingPolicy(ADMINS).getConfigName());
    assertEquals("root.users ordering policy", "fifo",
        csConfig.getAppOrderingPolicy(USERS).getConfigName());

    // root.users
    assertEquals("root.users.joe ordering policy", "fair",
        csConfig.getAppOrderingPolicy(USERS_JOE).getConfigName());
    assertEquals("root.users.john ordering policy", "fifo",
        csConfig.getAppOrderingPolicy(USERS_JOHN).getConfigName());

    // root.admins
    assertEquals("root.admins.alice ordering policy", "fifo",
        csConfig.getAppOrderingPolicy(ADMINS_ALICE).getConfigName());
    assertEquals("root.admins.bob ordering policy", "fair",
        csConfig.getAppOrderingPolicy(ADMINS_BOB).getConfigName());
  }