@Test
public void testAccessLocalNodeLabelManager() throws Exception {

  assertFalse(dummyNodeLabelsManager.getServiceState() == STATE.STOPPED);
  
  String[] args =
      { "-addToClusterNodeLabels", "x,y", "-directlyAccessNodeLabelStore" };
  assertEquals(0, rmAdminCLI.run(args));
  assertTrue(dummyNodeLabelsManager.getClusterNodeLabelNames().containsAll(
      ImmutableSet.of("x", "y")));
  
  // reset localNodeLabelsManager
  dummyNodeLabelsManager.removeFromClusterNodeLabels(ImmutableSet.of("x", "y"));
  
  // change the sequence of "-directlyAccessNodeLabelStore" and labels,
  // should fail
  args =
      new String[] { "-addToClusterNodeLabels",
          "-directlyAccessNodeLabelStore", "x,y" };
  assertEquals(-1, rmAdminCLI.run(args));
  
  // local node labels manager will be close after running
  assertTrue(dummyNodeLabelsManager.getServiceState() == STATE.STOPPED);
}