@Test
public void testAddToClusterNodeLabelsWithExclusivitySetting()
    throws Exception {

  // Parenthese not match
  String[] args = new String[] { "-addToClusterNodeLabels", "x(" };
  assertTrue(0 != rmAdminCLI.run(args));
  args = new String[] { "-addToClusterNodeLabels", "x)" };
  assertTrue(0 != rmAdminCLI.run(args));
  // Not expected key=value specifying inner parentese
  args = new String[] { "-addToClusterNodeLabels", "x(key=value)" };
  assertTrue(0 != rmAdminCLI.run(args));
  // Not key is expected, but value not
  args = new String[] { "-addToClusterNodeLabels", "x(exclusive=)" };
  assertTrue(0 != rmAdminCLI.run(args));
  // key=value both set
  args =
      new String[] { "-addToClusterNodeLabels",
          "w,x(exclusive=true), y(exclusive=false),z()",
          "-directlyAccessNodeLabelStore" };
  assertTrue(0 == rmAdminCLI.run(args));
  assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("w"));
  assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("x"));
  assertFalse(dummyNodeLabelsManager.isExclusiveNodeLabel("y"));
  assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("z"));
  // key=value both set, and some spaces need to be handled
  args =
      new String[] { "-addToClusterNodeLabels",
          "a (exclusive= true) , b( exclusive =false),c  ",
          "-directlyAccessNodeLabelStore" };
  assertTrue(0 == rmAdminCLI.run(args));
  assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("a"));
  assertFalse(dummyNodeLabelsManager.isExclusiveNodeLabel("b"));
  assertTrue(dummyNodeLabelsManager.isExclusiveNodeLabel("c"));
}