Skip to content

Commit 56acfc3

Browse files
committed
Merge branch 'master' into summary-printer-interface
2 parents 91d3f03 + 4d09d8c commit 56acfc3

File tree

221 files changed

+2655
-6728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+2655
-6728
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
33
## [3.0.0-SNAPSHOT](https://github.com/cucumber/cucumber-jvm/compare/v2.4.0...master) (In Git)
44

55
### Added
6+
* [Core] Implement [cucumber expressions](https://github.com/cucumber/cucumber/tree/master/cucumber-expressions) ([#1248](https://github.com/cucumber/cucumber-jvm/pull/1248) M.P. Korstanje, Björn Rasmusson, Marit van Dijk, Aslak Hellesøy)
7+
* Custom parameter types can be defined by implementing the `TypeRegistryConfigurer`.
68
* [Core] Add Before and AfterStep hooks ([#1323](https://github.com/cucumber/cucumber-jvm/pull/1323) Aniket, Björn Rasmusson, M.P. Korstanje)
79
* [Core, TestNG] Support the TestNG SkipException ([#1338](https://github.com/cucumber/cucumber-jvm/pull/1338), [#1340](https://github.com/cucumber/cucumber-jvm/pull/1340) Björn Rasmusson, M.P. Korstanje)
810

911
### Changed
12+
* [Core] Replace DataTable with [io.cucumber.datatable.DataTable](https://github.com/cucumber/cucumber/tree/master/datatable) ([#1248](https://github.com/cucumber/cucumber-jvm/pull/1248) M.P. Korstanje, Björn Rasmusson, Marit van Dijk)
13+
* Custom data table types can be defined by implementing the `TypeRegistryConfigurer`.
1014
* [Core] Include all hooks in the event stream generated by `--dry-run` ([#1323](https://github.com/cucumber/cucumber-jvm/pull/1323) Aniket, Björn Rasmusson, M.P. Korstanje)
1115
* [Spring] Limit context configuration to a single class. ([#1240](https://github.com/cucumber/cucumber-jvm/pull/1240), [#1246](https://github.com/cucumber/cucumber-jvm/pull/1246) Björn Rasmusson, M.P. Korstanje)
1216

1317
### Deprecated
1418
* [Core] Deprecate all methods but `TestStep.getCodeLocation` in favour of PickleStepTestStep and HookTestStep ([#1323](https://github.com/cucumber/cucumber-jvm/pull/1323) Aniket, Björn Rasmusson, M.P. Korstanje)
1519

1620
### Removed
21+
* [Core] Removed XStream and related functionality ([#1248](https://github.com/cucumber/cucumber-jvm/pull/1248) M.P. Korstanje, Björn Rasmusson, Marit van Dijk, Aslak Hellesøy)
22+
* `@Delimiter`, `@Format`, `@Transformer`,`@XStreamConverter`, `@XStreamConverters` and any other
23+
annotations from XStream will no longer work. These must be replaced by a `DataTableType` or `ParameterType`.
1724
* [Core] Remove deprecated constructors of `TestStep` ([#1323](https://github.com/cucumber/cucumber-jvm/pull/1323) Aniket, Björn Rasmusson, M.P. Korstanje)
1825
* [TestNG] Remove the support of mapping the whole test suite or each feature to TestNG tests ([#1339](https://github.com/cucumber/cucumber-jvm/pull/1339), [#1340](https://github.com/cucumber/cucumber-jvm/pull/1340) Björn Rasmusson, M.P. Korstanje)
1926
* [JUnit] Remove the obsolete JUnit option `--allow-started-ignored` (Björn Rasmusson)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You're most likely going to paste code and output, so familiarise yourself with
4848
<pre>
4949
```java
5050
// Why doesn't this work?
51-
@Given("I have (\\d+) cukes in my (.*)")
51+
@Given("I have {int} cukes in my {string}")
5252
public void some_cukes(int howMany, String what) {
5353
// HALP!
5454
}

android/src/main/java/cucumber/runtime/android/CucumberExecutor.java

+12-4
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,26 @@
33
import android.app.Instrumentation;
44
import android.content.Context;
55
import android.util.Log;
6+
import cucumber.api.TypeRegistryConfigurer;
67
import cucumber.api.CucumberOptions;
78
import cucumber.api.StepDefinitionReporter;
9+
import io.cucumber.stepexpression.TypeRegistry;
810
import cucumber.api.event.TestRunFinished;
911
import cucumber.api.java.ObjectFactory;
1012
import cucumber.runtime.Backend;
1113
import cucumber.runtime.ClassFinder;
1214
import cucumber.runtime.CucumberException;
15+
import cucumber.runtime.DefaultTypeRegistryConfiguration;
1316
import cucumber.runtime.Env;
17+
import cucumber.runtime.Reflections;
1418
import cucumber.runtime.Runtime;
1519
import cucumber.runtime.RuntimeOptions;
1620
import cucumber.runtime.RuntimeOptionsFactory;
1721
import cucumber.runtime.Stats;
1822
import cucumber.runtime.UndefinedStepsTracker;
1923
import cucumber.runtime.formatter.AndroidInstrumentationReporter;
2024
import cucumber.runtime.formatter.AndroidLogcatReporter;
25+
import cucumber.runtime.io.MultiLoader;
2126
import cucumber.runtime.io.ResourceLoader;
2227
import cucumber.runtime.java.JavaBackend;
2328
import cucumber.runtime.java.ObjectFactoryLoader;
@@ -26,10 +31,11 @@
2631
import gherkin.events.PickleEvent;
2732

2833
import java.io.IOException;
29-
import java.util.ArrayList;
3034
import java.util.Collection;
3135
import java.util.List;
3236

37+
import static java.util.Collections.singletonList;
38+
3339
/**
3440
* Executes the cucumber scenarios.
3541
*/
@@ -166,10 +172,12 @@ private RuntimeOptions createRuntimeOptions(final Context context) {
166172
}
167173

168174
private Collection<? extends Backend> createBackends() {
175+
final Reflections reflections = new Reflections(classFinder);
169176
final ObjectFactory delegateObjectFactory = ObjectFactoryLoader.loadObjectFactory(classFinder, Env.INSTANCE.get(ObjectFactory.class.getName()));
170177
final AndroidObjectFactory objectFactory = new AndroidObjectFactory(delegateObjectFactory, instrumentation);
171-
final List<Backend> backends = new ArrayList<Backend>();
172-
backends.add(new JavaBackend(objectFactory, classFinder));
173-
return backends;
178+
final TypeRegistryConfigurer typeRegistryConfigurer = reflections.instantiateExactlyOneSubclass(TypeRegistryConfigurer.class, MultiLoader.packageName(runtimeOptions.getGlue()), new Class[0], new Object[0], new DefaultTypeRegistryConfiguration());
179+
final TypeRegistry typeRegistry = new TypeRegistry(typeRegistryConfigurer.locale());
180+
typeRegistryConfigurer.configureTypeRegistry(typeRegistry);
181+
return singletonList(new JavaBackend(objectFactory, classFinder, typeRegistry));
174182
}
175183
}

core/pom.xml

+9-10
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@
1818
</dependency>
1919
<dependency>
2020
<groupId>io.cucumber</groupId>
21-
<artifactId>cucumber-jvm-deps</artifactId>
21+
<artifactId>gherkin</artifactId>
2222
</dependency>
2323
<dependency>
2424
<groupId>io.cucumber</groupId>
25-
<artifactId>gherkin</artifactId>
25+
<artifactId>tag-expressions</artifactId>
2626
</dependency>
2727
<dependency>
2828
<groupId>io.cucumber</groupId>
29-
<artifactId>tag-expressions</artifactId>
29+
<artifactId>cucumber-expressions</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>io.cucumber</groupId>
33+
<artifactId>datatable</artifactId>
3034
</dependency>
31-
3235
<dependency>
3336
<groupId>junit</groupId>
3437
<artifactId>junit</artifactId>
@@ -49,11 +52,7 @@
4952
<artifactId>jsoup</artifactId>
5053
<scope>test</scope>
5154
</dependency>
52-
<dependency>
53-
<groupId>joda-time</groupId>
54-
<artifactId>joda-time</artifactId>
55-
<scope>test</scope>
56-
</dependency>
55+
5756
<dependency>
5857
<groupId>org.webbitserver</groupId>
5958
<artifactId>webbit</artifactId>
@@ -64,6 +63,7 @@
6463
<artifactId>webbit-rest</artifactId>
6564
<scope>test</scope>
6665
</dependency>
66+
6767
</dependencies>
6868

6969
<build>
@@ -101,7 +101,6 @@
101101
<configuration>
102102
<instructions>
103103
<Bundle-Description />
104-
<Export-Package>cucumber.*</Export-Package>
105104
<DynamicImport-Package>*</DynamicImport-Package>
106105
</instructions>
107106
</configuration>
+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
package cucumber.api;
22

3+
/**
4+
* Represents an argument in for a step definition.
5+
* <p>
6+
* The step definition {@code I have {long} cukes in my belly}
7+
* when matched with {@code I have 7 cukes in my belly} will produce
8+
* one argument with value {@code "4"}, starting at {@code 7} and
9+
* ending at {@code 8}.
10+
*/
311
public interface Argument {
4-
Integer getOffset();
12+
String getValue();
513

6-
String getVal();
14+
int getStart();
15+
16+
int getEnd();
717
}

0 commit comments

Comments
 (0)