Permalink
Browse files

Optimise imports

  • Loading branch information...
1 parent db8c4fb commit 783433c44f34c5cea48ad63399a3b0e7d15cc696 @aslakhellesoy aslakhellesoy committed Mar 17, 2012
Showing with 205 additions and 75 deletions.
  1. +2 −1 core/pom.xml
  2. +11 −11 core/src/main/java/cucumber/formatter/FormatterConverter.java
  3. +17 −3 core/src/main/java/cucumber/formatter/HTMLFormatter.java
  4. +8 −1 core/src/main/java/cucumber/formatter/JUnitFormatter.java
  5. +8 −1 core/src/main/java/cucumber/formatter/ProgressFormatter.java
  6. +6 −1 core/src/main/java/cucumber/runtime/FeatureBuilder.java
  7. +12 −3 core/src/main/java/cucumber/runtime/Runtime.java
  8. +6 −2 core/src/main/java/cucumber/runtime/RuntimeGlue.java
  9. +2 −4 core/src/main/java/cucumber/runtime/RuntimeOptions.java
  10. +5 −1 core/src/main/java/cucumber/runtime/autocomplete/StepdefGenerator.java
  11. +5 −1 core/src/main/java/cucumber/runtime/converters/LocalizedXStreams.java
  12. +6 −1 core/src/main/java/cucumber/runtime/converters/TimeConverter.java
  13. +6 −1 core/src/main/java/cucumber/runtime/model/CucumberFeature.java
  14. +9 −1 core/src/main/java/cucumber/runtime/model/CucumberScenarioOutline.java
  15. +6 −1 core/src/main/java/cucumber/table/TableConverter.java
  16. +3 −1 core/src/test/java/cucumber/formatter/HTMLFormatterTest.java
  17. +1 −1 core/src/test/java/cucumber/formatter/JUnitFormatterTest.java
  18. +6 −1 core/src/test/java/cucumber/formatter/TestFormatter.java
  19. +4 −1 core/src/test/java/cucumber/runtime/HookOrderTest.java
  20. +3 −1 core/src/test/java/cucumber/runtime/HookTest.java
  21. +3 −1 core/src/test/java/cucumber/runtime/StepDefinitionMatchTest.java
  22. +6 −2 core/src/test/java/cucumber/runtime/UtilsTest.java
  23. +7 −1 core/src/test/java/cucumber/runtime/model/CucumberExamplesTest.java
  24. +5 −1 core/src/test/java/cucumber/runtime/model/CucumberScenarioOutlineTest.java
  25. +6 −1 core/src/test/java/cucumber/table/FromDataTableTest.java
  26. +4 −2 java/pom.xml
  27. +5 −1 java/src/main/java/cucumber/runtime/java/JavaStepDefinition.java
  28. +3 −1 java/src/test/java/cucumber/runtime/java/ClasspathMethodScannerTest.java
  29. +3 −1 java/src/test/java/cucumber/runtime/java/JavaHookTest.java
  30. +3 −1 java/src/test/java/cucumber/runtime/java/JavaStepDefinitionTest.java
  31. +2 −1 junit/pom.xml
  32. +7 −1 junit/src/main/java/cucumber/junit/JUnitReporter.java
  33. +7 −9 junit/src/main/java/cucumber/junit/RuntimeOptionsFactory.java
  34. +2 −2 junit/src/test/java/cucumber/junit/CucumberTest.java
  35. +3 −1 junit/src/test/java/cucumber/junit/JUnitReporterTest.java
  36. +12 −10 picocontainer/pom.xml
  37. +1 −1 pom.xml
View
3 core/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
View
22 core/src/main/java/cucumber/formatter/FormatterConverter.java
@@ -20,8 +20,8 @@
public class FormatterConverter implements IStringConverter<Formatter> {
private Class[] CTOR_ARGS = new Class[]{Appendable.class, File.class};
-
- private static final Map<String,Class<? extends Formatter>> FORMATTER_CLASSES = new HashMap<String, Class<? extends Formatter>>() {{
+
+ private static final Map<String, Class<? extends Formatter>> FORMATTER_CLASSES = new HashMap<String, Class<? extends Formatter>>() {{
put("junit", JUnitFormatter.class);
put("html", HTMLFormatter.class);
put("pretty", CucumberPrettyFormatter.class);
@@ -37,7 +37,7 @@ public Formatter convert(String formatterString) {
Matcher formatterWithFile = FORMATTER_WITH_FILE_PATTERN.matcher(formatterString);
String formatterName;
Object ctorArg;
- if(formatterWithFile.matches()) {
+ if (formatterWithFile.matches()) {
formatterName = formatterWithFile.group(1);
ctorArg = new File(formatterWithFile.group(2));
} else {
@@ -56,10 +56,10 @@ private Formatter instantiate(Class<? extends Formatter> formatterClass, Object
Constructor<? extends Formatter> constructor;
for (Class ctorArgClass : CTOR_ARGS) {
- constructor=findConstructor(formatterClass, ctorArgClass);
- if(constructor != null) {
+ constructor = findConstructor(formatterClass, ctorArgClass);
+ if (constructor != null) {
ctorArg = convert(ctorArg, ctorArgClass);
- if(ctorArg != null) {
+ if (ctorArg != null) {
try {
return constructor.newInstance(ctorArg);
} catch (InstantiationException e) {
@@ -76,13 +76,13 @@ private Formatter instantiate(Class<? extends Formatter> formatterClass, Object
}
private Object convert(Object ctorArg, Class ctorArgClass) throws IOException {
- if(ctorArgClass.isAssignableFrom(ctorArg.getClass())) {
+ if (ctorArgClass.isAssignableFrom(ctorArg.getClass())) {
return ctorArg;
}
- if(ctorArgClass.equals(File.class) && ctorArg instanceof File) {
+ if (ctorArgClass.equals(File.class) && ctorArg instanceof File) {
return ctorArg;
}
- if(ctorArgClass.equals(Appendable.class) && ctorArg instanceof File) {
+ if (ctorArgClass.equals(Appendable.class) && ctorArg instanceof File) {
return new FileWriter((File) ctorArg);
}
return null;
@@ -98,7 +98,7 @@ private Object convert(Object ctorArg, Class ctorArgClass) throws IOException {
private Class<? extends Formatter> formatterClass(String formatterName) {
Class<? extends Formatter> formatterClass = FORMATTER_CLASSES.get(formatterName);
- if(formatterClass == null) {
+ if (formatterClass == null) {
formatterClass = loadClass(formatterName);
}
return formatterClass;
@@ -114,7 +114,7 @@ private Object convert(Object ctorArg, Class ctorArgClass) throws IOException {
private Appendable defaultOutIfAvailable() {
try {
- if(defaultOut != null) {
+ if (defaultOut != null) {
return defaultOut;
} else {
throw new CucumberException("Only one formatter can use STDOUT. If you use more than one formatter you must specify output path with FORMAT:PATH");
View
20 core/src/main/java/cucumber/formatter/HTMLFormatter.java
@@ -7,9 +7,23 @@
import gherkin.formatter.Mappable;
import gherkin.formatter.NiceAppendable;
import gherkin.formatter.Reporter;
-import gherkin.formatter.model.*;
-
-import java.io.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.Match;
+import gherkin.formatter.model.Result;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
View
9 core/src/main/java/cucumber/formatter/JUnitFormatter.java
@@ -3,7 +3,14 @@
import cucumber.runtime.CucumberException;
import gherkin.formatter.Formatter;
import gherkin.formatter.Reporter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.Match;
+import gherkin.formatter.model.Result;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
View
9 core/src/main/java/cucumber/formatter/ProgressFormatter.java
@@ -4,7 +4,14 @@
import gherkin.formatter.NiceAppendable;
import gherkin.formatter.Reporter;
import gherkin.formatter.ansi.AnsiEscapes;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.Match;
+import gherkin.formatter.model.Result;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
import java.io.InputStream;
import java.util.HashMap;
View
7 core/src/main/java/cucumber/runtime/FeatureBuilder.java
@@ -5,7 +5,12 @@
import gherkin.I18n;
import gherkin.formatter.FilterFormatter;
import gherkin.formatter.Formatter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
import gherkin.parser.Parser;
import gherkin.util.FixJava;
View
15 core/src/main/java/cucumber/runtime/Runtime.java
@@ -8,10 +8,20 @@
import gherkin.I18n;
import gherkin.formatter.Formatter;
import gherkin.formatter.Reporter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Comment;
+import gherkin.formatter.model.DataTableRow;
+import gherkin.formatter.model.DocString;
+import gherkin.formatter.model.Match;
+import gherkin.formatter.model.Result;
+import gherkin.formatter.model.Step;
+import gherkin.formatter.model.Tag;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
/**
* This is the main entry point for running Cucumber features.
@@ -66,7 +76,6 @@ public void addError(Throwable error) {
/**
* This is the main entry point. Used from CLI, but not from JUnit.
- *
*/
public void run() {
for (CucumberFeature cucumberFeature : runtimeOptions.cucumberFeatures(resourceLoader)) {
View
8 core/src/main/java/cucumber/runtime/RuntimeGlue.java
@@ -14,7 +14,11 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
import static cucumber.runtime.model.CucumberFeature.load;
import static java.util.Collections.emptyList;
@@ -96,7 +100,7 @@ public StepDefinitionMatch stepDefinitionMatch(String uri, Step step, I18n i18n)
@Override
public void writeStepdefsJson(List<String> featurePaths, File dotCucumber) throws IOException {
- if(dotCucumber != null) {
+ if (dotCucumber != null) {
List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS);
List<MetaStepdef> metaStepdefs = new StepdefGenerator().generate(stepDefinitionsByPattern.values(), features);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
View
6 core/src/main/java/cucumber/runtime/RuntimeOptions.java
@@ -19,7 +19,6 @@
import java.util.List;
import static cucumber.runtime.model.CucumberFeature.load;
-import static java.util.Arrays.asList;
public class RuntimeOptions {
@Parameter(names = {"-g", "--glue"}, description = "Where cucumber looks for step definitions and hooks.")
@@ -49,7 +48,7 @@ public RuntimeOptions(String... args) {
cmd.setProgramName("cucumber");
cmd.parse(args);
- if(formatters.isEmpty()) {
+ if (formatters.isEmpty()) {
formatters.add(new ProgressFormatter(System.out));
}
}
@@ -96,8 +95,7 @@ public Object invoke(Object target, Method method, Object[] args) throws Throwab
public Class<? extends IStringConverter<?>> getConverter(Class forType) {
if (forType.equals(Formatter.class)) {
return FormatterConverter.class;
- }
- else return null;
+ } else return null;
}
}
View
6 core/src/main/java/cucumber/runtime/autocomplete/StepdefGenerator.java
@@ -6,7 +6,11 @@
import gherkin.formatter.Argument;
import gherkin.formatter.model.Step;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
/**
* Generates metadata to be used for Code Completion: https://github.com/cucumber/gherkin/wiki/Code-Completion
View
6 core/src/main/java/cucumber/runtime/converters/LocalizedXStreams.java
@@ -5,7 +5,11 @@
import com.thoughtworks.xstream.core.DefaultConverterLookup;
import gherkin.I18n;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
public class LocalizedXStreams {
private final Map<I18n, LocalizedXStream> xStreams = new HashMap<I18n, LocalizedXStream>();
View
7 core/src/main/java/cucumber/runtime/converters/TimeConverter.java
@@ -6,7 +6,12 @@
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.TimeZone;
import static java.util.Arrays.asList;
View
7 core/src/main/java/cucumber/runtime/model/CucumberFeature.java
@@ -8,7 +8,12 @@
import gherkin.I18n;
import gherkin.formatter.Formatter;
import gherkin.formatter.Reporter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
import java.util.ArrayList;
import java.util.Collections;
View
10 core/src/main/java/cucumber/runtime/model/CucumberScenarioOutline.java
@@ -3,7 +3,15 @@
import cucumber.runtime.Runtime;
import gherkin.formatter.Formatter;
import gherkin.formatter.Reporter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.DataTableRow;
+import gherkin.formatter.model.DocString;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.ExamplesTableRow;
+import gherkin.formatter.model.Row;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
+import gherkin.formatter.model.Tag;
import java.util.ArrayList;
import java.util.HashSet;
View
7 core/src/main/java/cucumber/table/TableConverter.java
@@ -5,7 +5,12 @@
import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import cucumber.runtime.CucumberException;
-import cucumber.table.xstream.*;
+import cucumber.table.xstream.DataTableWriter;
+import cucumber.table.xstream.ListOfListOfSingleValueReader;
+import cucumber.table.xstream.ListOfListOfSingleValueWriter;
+import cucumber.table.xstream.ListOfMapReader;
+import cucumber.table.xstream.ListOfObjectReader;
+import cucumber.table.xstream.ListOfObjectWriter;
import gherkin.util.Mapper;
import java.lang.reflect.ParameterizedType;
View
4 core/src/test/java/cucumber/formatter/HTMLFormatterTest.java
@@ -13,7 +13,9 @@
import java.io.FileReader;
import java.io.IOException;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
public class HTMLFormatterTest {
View
2 core/src/test/java/cucumber/formatter/JUnitFormatterTest.java
@@ -45,7 +45,7 @@ private File runFeaturesWithJunitFormatter(final List<String> featurePaths) thro
File report = File.createTempFile("cucumber-jvm-junit", "xml");
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
final ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader(classLoader);
-
+
List<String> args = new ArrayList<String>();
args.add("--format");
args.add("junit:" + report.getAbsolutePath());
View
7 core/src/test/java/cucumber/formatter/TestFormatter.java
@@ -1,7 +1,12 @@
package cucumber.formatter;
import gherkin.formatter.Formatter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
import org.junit.Ignore;
import java.io.File;
View
5 core/src/test/java/cucumber/runtime/HookOrderTest.java
@@ -14,7 +14,10 @@
import static java.util.Arrays.asList;
import static org.mockito.Matchers.anyListOf;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
public class HookOrderTest {
View
4 core/src/test/java/cucumber/runtime/HookTest.java
@@ -17,7 +17,9 @@
import static java.util.Arrays.asList;
import static org.mockito.Matchers.anyListOf;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
public class HookTest {
View
4 core/src/test/java/cucumber/runtime/StepDefinitionMatchTest.java
@@ -13,7 +13,9 @@
import java.util.List;
import static java.util.Arrays.asList;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
public class StepDefinitionMatchTest {
private final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
View
8 core/src/test/java/cucumber/runtime/UtilsTest.java
@@ -2,8 +2,12 @@
import org.junit.Test;
-import static cucumber.runtime.Utils.*;
-import static org.junit.Assert.*;
+import static cucumber.runtime.Utils.isInstantiable;
+import static cucumber.runtime.Utils.packageName;
+import static cucumber.runtime.Utils.packagePath;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
public class UtilsTest {
@Test
View
8 core/src/test/java/cucumber/runtime/model/CucumberExamplesTest.java
@@ -1,6 +1,12 @@
package cucumber.runtime.model;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Comment;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.ExamplesTableRow;
+import gherkin.formatter.model.Feature;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
+import gherkin.formatter.model.Tag;
import org.junit.Test;
import java.util.HashSet;
View
6 core/src/test/java/cucumber/runtime/model/CucumberScenarioOutlineTest.java
@@ -1,6 +1,10 @@
package cucumber.runtime.model;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Comment;
+import gherkin.formatter.model.DataTableRow;
+import gherkin.formatter.model.DocString;
+import gherkin.formatter.model.ExamplesTableRow;
+import gherkin.formatter.model.Step;
import org.junit.Test;
import java.util.ArrayList;
View
7 core/src/test/java/cucumber/table/FromDataTableTest.java
@@ -23,7 +23,12 @@
import org.junit.rules.ExpectedException;
import java.lang.reflect.Method;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
View
6 java/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -54,7 +55,8 @@
<phase>generate-sources</phase>
<configuration>
<target>
- <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="maven.plugin.classpath" />
+ <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"
+ classpathref="maven.plugin.classpath"/>
<groovy><![CDATA[
import groovy.text.SimpleTemplateEngine
View
6 java/src/main/java/cucumber/runtime/java/JavaStepDefinition.java
@@ -1,7 +1,11 @@
package cucumber.runtime.java;
import cucumber.annotation.Pending;
-import cucumber.runtime.*;
+import cucumber.runtime.CucumberException;
+import cucumber.runtime.JdkPatternArgumentMatcher;
+import cucumber.runtime.ParameterType;
+import cucumber.runtime.PendingException;
+import cucumber.runtime.StepDefinition;
import gherkin.I18n;
import gherkin.formatter.Argument;
import gherkin.formatter.model.Step;
View
4 java/src/test/java/cucumber/runtime/java/ClasspathMethodScannerTest.java
@@ -9,7 +9,9 @@
import org.mockito.internal.util.reflection.Whitebox;
import static java.util.Arrays.asList;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
public class ClasspathMethodScannerTest {
View
4 java/src/test/java/cucumber/runtime/java/JavaHookTest.java
@@ -15,7 +15,9 @@
import java.util.Collections;
import static java.util.Arrays.asList;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
public class JavaHookTest {
View
4 java/src/test/java/cucumber/runtime/java/JavaStepDefinitionTest.java
@@ -22,7 +22,9 @@
import java.util.Set;
import static java.util.Arrays.asList;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
View
3 junit/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
View
8 junit/src/main/java/cucumber/junit/JUnitReporter.java
@@ -3,7 +3,13 @@
import cucumber.runtime.PendingException;
import gherkin.formatter.Formatter;
import gherkin.formatter.Reporter;
-import gherkin.formatter.model.*;
+import gherkin.formatter.model.Background;
+import gherkin.formatter.model.Examples;
+import gherkin.formatter.model.Match;
+import gherkin.formatter.model.Result;
+import gherkin.formatter.model.Scenario;
+import gherkin.formatter.model.ScenarioOutline;
+import gherkin.formatter.model.Step;
import org.junit.internal.runners.model.EachTestNotifier;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
View
16 junit/src/main/java/cucumber/junit/RuntimeOptionsFactory.java
@@ -2,7 +2,6 @@
import cucumber.runtime.RuntimeOptions;
-import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -29,21 +28,20 @@ public RuntimeOptions create() {
}
- private Cucumber.Options getFeatureAnnotation(Class clazz) {
- Annotation annotation = clazz.getAnnotation(Cucumber.Options.class);
- return Cucumber.Options.class.cast(annotation);
+ private Cucumber.Options getFeatureAnnotation(Class<?> clazz) {
+ return clazz.getAnnotation(Cucumber.Options.class);
}
private void addDryRun(Cucumber.Options options, List<String> args) {
- if(options != null) {
- if(options.dryRun()) {
+ if (options != null) {
+ if (options.dryRun()) {
args.add("--dry-run");
}
}
}
private void addGlue(Cucumber.Options options, Class clazz, List<String> args) {
- if(options != null && options.glue().length != 0) {
+ if (options != null && options.glue().length != 0) {
for (String glue : options.glue()) {
args.add("--glue");
args.add(glue);
@@ -55,15 +53,15 @@ private void addGlue(Cucumber.Options options, Class clazz, List<String> args) {
}
private void addFeatures(Cucumber.Options options, Class clazz, List<String> args) {
- if(options != null && options.features().length != 0) {
+ if (options != null && options.features().length != 0) {
Collections.addAll(args, options.features());
} else {
args.add(packagePath(clazz));
}
}
private void addTags(Cucumber.Options options, List<String> args) {
- if(options != null) {
+ if (options != null) {
for (String tags : options.tags()) {
args.add("--tags");
args.add(tags);
View
4 junit/src/test/java/cucumber/junit/CucumberTest.java
@@ -52,11 +52,11 @@ public void finds_no_features_when_explicit_package_has_nothnig() throws IOExcep
private class ImplicitPackage {
}
- @Cucumber.Options(features={"cucumber/junit"})
+ @Cucumber.Options(features = {"cucumber/junit"})
private class ExplicitPackage {
}
- @Cucumber.Options(features={"gibber/ish"})
+ @Cucumber.Options(features = {"gibber/ish"})
private class ExplicitPackageWithNoFeatures {
}
}
View
4 junit/src/test/java/cucumber/junit/JUnitReporterTest.java
@@ -11,7 +11,9 @@
import org.mockito.ArgumentCaptor;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
public class JUnitReporterTest {
View
22 picocontainer/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -73,15 +74,16 @@
</goals>
<configuration>
<target>
- <echo message="Running CLI test for picocontainer" />
- <java classname="cucumber.cli.Main" fork="true" failonerror="true" newenvironment="true" maxmemory="512m" classpathref="maven.test.classpath">
- <arg value="--dotcucumber" />
- <arg value="${basedir}/src/test/resources/.cucumber" />
- <arg value="--format" />
- <arg value="progress" />
- <arg value="--glue" />
- <arg value="cucumber.runtime.java.picocontainer" />
- <arg value="${basedir}/src/test/resources/cucumber/runtime/java/picocontainer" />
+ <echo message="Running CLI test for picocontainer"/>
+ <java classname="cucumber.cli.Main" fork="true" failonerror="true" newenvironment="true"
+ maxmemory="512m" classpathref="maven.test.classpath">
+ <arg value="--dotcucumber"/>
+ <arg value="${basedir}/src/test/resources/.cucumber"/>
+ <arg value="--format"/>
+ <arg value="progress"/>
+ <arg value="--glue"/>
+ <arg value="cucumber.runtime.java.picocontainer"/>
+ <arg value="${basedir}/src/test/resources/cucumber/runtime/java/picocontainer"/>
</java>
</target>
</configuration>
View
2 pom.xml
@@ -17,7 +17,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<outputDirectory>${project.build.directory}</outputDirectory>
- <gherkin.version>2.9.0</gherkin.version>
+ <gherkin.version>2.9.1</gherkin.version>
<groovy.version>2.0.0-beta-2</groovy.version>
</properties>
<licenses>

0 comments on commit 783433c

Please sign in to comment.