FSConfigToCSConfigRuleHandler { public void handleChildQueueCount(String queue, int count) { String value = properties.getProperty(MAX_CHILD_QUEUE_LIMIT); if (value != null) { if (StringUtils.isNumeric(value)) { int maxChildQueue = Integer.parseInt(value); if (count > maxChildQueue) { throw new ConversionException( format("Queue %s has too many children: %d", queue, count)); } } else { throw new ConversionException( "Rule setting: maxChildQueue.limit is not an integer"); } } } FSConfigToCSConfigRuleHandler(ConversionOptions conversionOptions); @VisibleForTesting  FSConfigToCSConfigRuleHandler(Properties props,
      ConversionOptions conversionOptions); void initPropertyActions(); void handleMaxCapacityPercentage(String queueName); void handleMaxChildCapacity(); void handleMaxResources(); void handleMinResources(); void handleChildQueueCount(String queue, int count); void handleDynamicMaxAssign(); void handleReservationSystem(); void handleFairAsDrf(String queueName); void handleRuleAutoCreateFlag(String queue); void handleFSParentCreateFlag(String parentPath); void handleChildStaticDynamicConflict(String parentPath); @VisibleForTesting Map<String, RuleAction> getActions(); static final String MAX_CHILD_QUEUE_LIMIT; static final String MAX_CAPACITY_PERCENTAGE; static final String MAX_CHILD_CAPACITY; static final String MAX_RESOURCES; static final String MIN_RESOURCES; static final String USER_MAX_RUNNING_APPS; static final String USER_MAX_APPS_DEFAULT; static final String DYNAMIC_MAX_ASSIGN; static final String SPECIFIED_NOT_FIRST; static final String RESERVATION_SYSTEM; static final String QUEUE_AUTO_CREATE; static final String FAIR_AS_DRF; static final String QUEUE_DYNAMIC_CREATE; static final String PARENT_DYNAMIC_CREATE; static final String CHILD_STATIC_DYNAMIC_CONFLICT; }
@Test(expected = ConversionException.class) public void testMaxChildQueueCountNotInteger() throws IOException { Properties rules = new Properties(); rules.put(MAX_CHILD_QUEUE_LIMIT, "abc"); ruleHandler = new FSConfigToCSConfigRuleHandler(rules, createDefaultConversionOptions()); ruleHandler.handleChildQueueCount("test", 1); }