IndexOptions implements OptionsBean { public List<String> getIndexPaths(){ return options.has(indexPaths) ? trim(indexPaths.values(options)) : Collections.emptyList(); } IndexOptions(OptionParser parser); @Override void configure(OptionSet options); @Override String title(); @Override String description(); @Override int order(); @Override Set<String> operationNames(); File getWorkDir(); File getOutDir(); File getPreExtractedTextDir(); File getIndexDefinitionsFile(); File getIndexImportDir(); boolean dumpStats(); boolean dumpDefinitions(); boolean dumpIndex(); boolean checkConsistency(); int consistencyCheckLevel(); boolean isReindex(); boolean isImportIndex(); boolean isDocTraversalMode(); String getCheckpoint(); List<String> getIndexPaths(); static final OptionsBeanFactory FACTORY; }
@Test public void indexPathsAreTrimmed() throws Exception{ options.parseAndConfigure(parser, new String[] {"--index-paths=foo, bar, baz ,"}); IndexOptions idxOpts = options.getOptionBean(IndexOptions.class); List<String> paths = idxOpts.getIndexPaths(); assertEquals(3, paths.size()); assertThat(paths, hasItems("foo", "bar", "baz")); }