RunnerOptions { public static RunnerOptions parseStringArgs(String[] args) { RunnerOptions options = CommandLine.populateCommand(new RunnerOptions(), args); List<String> featuresTemp = new ArrayList(); if (options.features != null) { for (String s : options.features) { if (s.startsWith("com.") || s.startsWith("cucumber.") || s.startsWith("org.")) { continue; } featuresTemp.add(s); } options.features = featuresTemp.isEmpty() ? null : featuresTemp; } return options; }  List<String> getTags(); String getName(); void addFeature(String feature); List<String> getFeatures(); int getThreads(); int getDebugPort(); static RunnerOptions parseStringArgs(String[] args); static RunnerOptions parseCommandLine(String line); static RunnerOptions fromAnnotationAndSystemProperties(List<String> features, List<String> tags, Class<?> clazz);  }
@Test public void testArgs() { RunnerOptions options = RunnerOptions.parseStringArgs(new String[]{}); assertNull(options.features); assertNull(options.tags); assertNull(options.name); options = RunnerOptions.parseStringArgs(new String[]{"--name", "foo"}); assertNull(options.features); assertNull(options.tags); assertEquals("foo", options.name); options = RunnerOptions.parseStringArgs(new String[]{"--tags", "~@ignore"}); assertNull(options.features); assertEquals("~@ignore", options.tags.get(0)); assertNull(options.name); options = RunnerOptions.parseStringArgs(new String[]{"--tags", "~@ignore", "foo.feature"}); assertEquals("foo.feature", options.features.get(0)); assertEquals("~@ignore", options.tags.get(0)); assertNull(options.name); }