private ConfigExtractor getTestConfig(boolean sleep) throws Exception { ArgumentParser parser = new ArgumentParser(getTestArgs(sleep)); ParsedOutput out = parser.parse(); assertTrue(!out.shouldOutputHelp()); ConfigMerger merge = new ConfigMerger(); Configuration cfg = merge.getMerged(out, getBaseConfig()); ConfigExtractor extractor = new ConfigExtractor(cfg); return extractor; }
/** * Merges the given command line parsed output with the given configuration * object and returns the new configuration object with the correct options * overwritten * * @param opts * the parsed command line option output * @param base * the base configuration to merge with * @return merged configuration object * @throws ConfigException * when configuration errors or verification occur */ Configuration getMerged(ParsedOutput opts, Configuration base) throws ConfigException { return handleOptions(opts, base); }