QueueManager { @VisibleForTesting boolean isQueueNameValid(String node) { return !node.isEmpty() && node.equals(node.trim()); } QueueManager(FairScheduler scheduler); FSParentQueue getRootQueue(); void initialize(Configuration conf); FSLeafQueue getLeafQueue(String name, boolean create); FSLeafQueue getLeafQueue(
      String name,
      boolean create,
      boolean recomputeSteadyShares); boolean removeLeafQueue(String name); FSParentQueue getParentQueue(String name, boolean create); FSParentQueue getParentQueue(
      String name,
      boolean create,
      boolean recomputeSteadyShares); FSQueue getQueue(String name); boolean exists(String name); Collection<FSLeafQueue> getLeafQueues(); Collection<FSQueue> getQueues(); void updateAllocationConfiguration(AllocationConfiguration queueConf); static final Log LOG; static final String ROOT_QUEUE; }
@Test public void testCheckQueueNodeName() { assertFalse(queueManager.isQueueNameValid("")); assertFalse(queueManager.isQueueNameValid(" ")); assertFalse(queueManager.isQueueNameValid(" a")); assertFalse(queueManager.isQueueNameValid("a ")); assertFalse(queueManager.isQueueNameValid(" a ")); assertTrue(queueManager.isQueueNameValid("a b")); assertTrue(queueManager.isQueueNameValid("a")); }