Skip to content

Continue Lambda type annotations #1782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Sep 28, 2019
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6f62ce8
[DocString] Fix automatic-module-name
mpkorstanje Sep 6, 2019
bd16fe2
Note about using snapshot version of cucumber-eclipse plugin for 4.5.…
Shiridish-BK Sep 7, 2019
29e9970
[Core] Update Gherkin to v5.2.0
mpkorstanje Sep 8, 2019
5a39786
[Core] Push Scenario down to backend modules
mpkorstanje Sep 8, 2019
e387435
[JUnit] Remove cucumber.api glue annotation check
mpkorstanje Sep 8, 2019
69ba8da
[Guice] Remove use of deprecated constants
mpkorstanje Sep 8, 2019
50557c4
[Java] Use the language name and native name in package info
mpkorstanje Sep 8, 2019
908fb9a
[Java8] Use the language name and native name in package info
mpkorstanje Sep 8, 2019
28ae5dd
[Core] CLI Adds progress/summary if no other plugin is selected
mpkorstanje Sep 9, 2019
be97045
[Core] Remove `cucumber.rerun-file` in favour of `cucumber.features`
mpkorstanje Sep 10, 2019
b6765fc
[Core] Upgrade to junit jupiter 5.5.2
mpkorstanje Sep 10, 2019
890e76f
Update CHANGELOG
mpkorstanje Sep 10, 2019
0bf23d7
Update issue templates
mpkorstanje Sep 11, 2019
ab2269d
[Core] Fix timeline formatter (#1769)
aslakhellesoy Sep 12, 2019
96e6aa1
Detect JavaDoc errors (#1771)
aslakhellesoy Sep 12, 2019
7df31da
Attribution for #1759 and #1769
aslakhellesoy Sep 12, 2019
07a3b49
[Code] Clean up unnecessary public modifiers (#1775)
mpkorstanje Sep 12, 2019
040280a
[Core] Clean up TypeResolver
mpkorstanje Sep 12, 2019
bd539c3
[Core] Move Snippet into backend package
mpkorstanje Sep 12, 2019
735eab4
[Core] Remove detail parameter from getLocation
mpkorstanje Sep 13, 2019
8ee4880
[Core] Extract Plugin module (#1774)
mpkorstanje Sep 13, 2019
14e6ffd
[Core] Fix JUnit report xml attributes (#1778)
mpkorstanje Sep 22, 2019
1f90854
[Core] Rework backend (#1776)
mpkorstanje Sep 22, 2019
a5499df
Print supported languages details (#1290)
tsundberg Sep 22, 2019
53c9485
Attribution for #1769
aslakhellesoy Sep 26, 2019
d1c4c91
[Core] Rename TypeRegistry to StepTypeRegistry
mpkorstanje Sep 26, 2019
669dd85
[Core] Rename Scenario to TestCaseState
mpkorstanje Sep 26, 2019
b8e44dd
Merge remote-tracking branch 'origin/master' into
Sep 26, 2019
edb0b77
Remove unused timeout
Sep 26, 2019
ecb8424
Work in progress; Added ParameterType with two arguments (broken still)
Sep 27, 2019
350c91b
Alter example to do away with Point class
Sep 27, 2019
529c21c
Switch to StringBuffer to actually return a different type
Sep 27, 2019
59960fb
Expand multi argument example to three
Sep 27, 2019
c097b5a
Add example that maps to Map.Entry
Sep 27, 2019
d9e3816
Demonstrate issues parsing any non-string arguments
Sep 27, 2019
c0efd78
One step closer
Sep 27, 2019
0e0dcce
Only support String arguments after looking at Java & Expressions
Sep 27, 2019
fdefbf4
Remove Class<T> bodyClass arg as we're only using first type argument
Sep 27, 2019
de71b15
Add ParameterTypes with 4-9 arguments
Sep 27, 2019
3099f1b
Sprinkle on a few more generics
Sep 27, 2019
3ef30f5
Add more LambdaGlue
Sep 27, 2019
fef6bc1
Do not reintroduce AfterStep with timeout argument
Sep 27, 2019
d12aa24
First JavaDoc
Sep 27, 2019
f9ac282
Add more JavaDoc
Sep 27, 2019
9265fcd
Fix compilation error in Travis
Sep 27, 2019
04ff667
Map.Entry is only in Java11; so drop that test
Sep 27, 2019
6ad67f8
Harmonize project names in Maven output
Sep 28, 2019
36fd570
Remove left over Map.Entry scenario
Sep 28, 2019
e727622
Remove generics from ParameterTypeDefinition & ParameterDefinitionBody
Sep 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Context & Motivation**

How has this issue affected you? What are you trying to accomplish? Providing context helps us come up with a solution that is most useful in the real world.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Your Environment**
- Versions used [e.g 5.0.0]
- Operating System and version [e.g. * Operating System and version:]
- Build tool [e.g. Apache Maven 3.6.0]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Feature Request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- jdk: openjdk11
script: mvn -q verify

# 1.3 Check java doc
- jdk: openjdk8
# 1.3 Check javadoc. We need to use this version to properly detect errors.
- jdk: oraclejdk11
env: JAVADOC=true
script:
- mvn clean verify -DskipTests=true
Expand Down
24 changes: 14 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
## [5.0.0-SNAPSHOT](https://github.com/cucumber/cucumber-jvm/compare/v4.7.1...master) (In Git)

### Added
* [Core] Upgrade the timeline formatter's jQuery dependency from 3.3.1 to 3.4.1. jQuery 3.3.1 has an [XSS vulnerability](https://www.cvedetails.com/cve/CVE-2019-11358/)
that wouldn't normally affect the timeline formatter. However, it did prevent some organisations from downloading the cucumber-core jar because nexus would block it.
([#1759](https://github.com/cucumber/cucumber-jvm/issues/1759), [#1769](https://github.com/cucumber/cucumber-jvm/pull/1769) Vincent Pretre, Aslak Hellesøy)
* [Core] Add `object-factory` option to CLI and `@CucumberOptions`. ([#1710](https://github.com/cucumber/cucumber-jvm/pull/1710) Ralph Kar)
* [Java] Allow parameter types access to the test context ([#851](https://github.com/cucumber/cucumber-jvm/issues/851), [#1458](https://github.com/cucumber/cucumber-jvm/issues/1458) M.P. Korstanje)
- Add `@ParameterType` alternative for `TypeRegistry.defineParameterType`
Expand All @@ -23,11 +26,9 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
- cucumber.execution.dry-run
- cucumber.execution.limit
- cucumber.execution.order
- cucumber.execution.parallel.config.fixed.parallelism
- cucumber.execution.strict
- cucumber.execution.wip
- cucumber.feature
- cucumber.rerun-file
- cucumber.filter.name
- cucumber.filter.tags
- cucumber.glue
Expand All @@ -36,11 +37,12 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
- cucumber.snippet-type

### Changed
* [All] New package structure ([#1445](https://github.com/cucumber/cucumber-jvm/pull/1445), [#1448](https://github.com/cucumber/cucumber-jvm/issues/1448), [#1449](https://github.com/cucumber/cucumber-jvm/pull/1449) M.P. Korstanje)
* [All] New package structure ([#1445](https://github.com/cucumber/cucumber-jvm/pull/1445), [#1448](https://github.com/cucumber/cucumber-jvm/issues/1448), [#1449](https://github.com/cucumber/cucumber-jvm/pull/1449), [#1760](https://github.com/cucumber/cucumber-jvm/pull/1760) M.P. Korstanje)
- Adds `Automatic-Module-Name` to each module
- Roots packages in `io.cucumber.<module>`
- Use `find . -name '*.java' -exec sed -i 's/import cucumber.api/import io.cucumber/g' {} \; -exec sed -i 's/cucumber.CucumberOptions/cucumber.junit.CucumberOptions/g' {} \;` to adopt 90% of the new package structure
- Use @API Guardian annotations to mark the public API ([#1536](https://github.com/cucumber/cucumber-jvm/issues/1536) M.P. Korstanje)
- Limits the transitive use `cucumber-core` for regular users
* [All] Compile using source and target level 8 ([#1611](https://github.com/cucumber/cucumber-jvm/issues/1611) M.P. Korstanje)
* [Java8] Remove `cucumber-java8` dependency on `cucumber-java`
- To use both lambda and annotation based step definitions add a dependency on `cucumber-java` and `cucumber-java8`
Expand Down Expand Up @@ -72,18 +74,16 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
- Adds dedicated `io.cucumber.docstring.DocString` object to use in step definitions
- Adds `TypeRegistry.defineDocStringType`
- Adds `@DocStringType` alternative for `TypeRegistry.defineDocStringType`

### Deprecated
* [Core] Deprecate `timeout` ([#1506](https://github.com/cucumber/cucumber-jvm/issues/1506), [#1694](https://github.com/cucumber/cucumber-jvm/issues/1694) M.P. Korstanje)
- Prefer using library based solutions
* [JUnit 5 `Assertions.assertTimeout*`](https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html#assertTimeout-java.time.Duration-org.junit.jupiter.api.function.Executable-)
* [Awaitility](https://github.com/awaitility/awaitility)
* [Guava `TimeLimiter`](https://github.com/google/guava/blob/master/guava/src/com/google/common/util/concurrent/TimeLimiter.java)

### Removed
- [Core] Remove deprecated tag syntax.
- [Core] Remove `StepDefinitionReporter` ([#1635](https://github.com/cucumber/cucumber-jvm/issues/1635) M.P. Korstanje, Tim te Beek)
- Listen `StepDefined` events instead
* [Core] Remove `timeout` ([#1506](https://github.com/cucumber/cucumber-jvm/issues/1506), [#1694](https://github.com/cucumber/cucumber-jvm/issues/1694) M.P. Korstanje)
- Prefer using library based solutions
* [JUnit 5 `Assertions.assertTimeout*`](https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html#assertTimeout-java.time.Duration-org.junit.jupiter.api.function.Executable-)
* [Awaitility](https://github.com/awaitility/awaitility)
* [Guava `TimeLimiter`](https://github.com/google/guava/blob/master/guava/src/com/google/common/util/concurrent/TimeLimiter.java)

### Fixed
- [Java8] Set default before hook order to the same after hook (1000)
Expand Down Expand Up @@ -171,6 +171,10 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
- It is recommended to implement your own transaction hooks.
- Will allow the dependency on `spring-txn` to be removed.

### Note
Use the snapshot version of the cucumber-eclipse plugin for cucumber 4.5.0 and above that supports the new package structure. To use the latest snapshot version, refer [Follow the latest snapshot](https://github.com/cucumber/cucumber-eclipse#follow-the-latest-snapshot)


## [4.4.0](https://github.com/cucumber/cucumber-jvm/compare/v4.3.1...v4.0.0) (2019-06-15)

### Added
Expand Down
16 changes: 13 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<properties>
<project.Automatic-Module-Name>io.cucumber.core</project.Automatic-Module-Name>
<jsoup.version>1.12.1</jsoup.version>
<xmlunit.version>1.6</xmlunit.version>
<xmlunit.version>2.6.3</xmlunit.version>
<webbit.version>0.4.15</webbit.version>
<webbit-rest.version>0.3.0</webbit-rest.version>
<hamcrest-json.version>0.2</hamcrest-json.version>
Expand All @@ -37,6 +37,10 @@
<groupId>io.cucumber</groupId>
<artifactId>datatable</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-plugin</artifactId>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>docstring</artifactId>
Expand All @@ -47,8 +51,14 @@
</dependency>

<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-matchers</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/io/cucumber/core/backend/Backend.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.cucumber.core.backend;

import io.cucumber.core.snippets.Snippet;
import org.apiguardian.api.API;

import java.net.URI;
Expand All @@ -20,7 +19,7 @@ public interface Backend {
* Invoked before a new scenario starts. Implementations should do any necessary
* setup of new, isolated state here. Additional scenario scoped step definitions
* can be loaded here. These step definitions should implement
* {@link io.cucumber.core.runner.ScenarioScoped}
* {@link ScenarioScoped}
*/
void buildWorld();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package io.cucumber.core.backend;

import io.cucumber.core.io.ResourceLoader;
import org.apiguardian.api.API;

import java.util.function.Supplier;

@API(status = API.Status.STABLE)
public interface BackendProviderService {

Backend create(Lookup lookup, Container container, ResourceLoader resourceLoader);
Backend create(Lookup lookup, Container container, Supplier<ClassLoader> classLoader);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.cucumber.core.backend;

public class CucumberBackendException extends RuntimeException {

public CucumberBackendException(String message) {
super(message);
}

public CucumberBackendException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.cucumber.core.backend;

import java.lang.reflect.InvocationTargetException;

public class CucumberInvocationTargetException extends RuntimeException {

private final Located located;
private final InvocationTargetException invocationTargetException;

public CucumberInvocationTargetException(Located located, InvocationTargetException invocationTargetException) {
this.located = located;
this.invocationTargetException = invocationTargetException;
}

public Throwable getInvocationTargetExceptionCause() {
return invocationTargetException.getCause();
}

public Located getLocated() {
return located;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@
import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public interface DataTableTypeDefinition {
public interface DataTableTypeDefinition extends Located {

DataTableType dataTableType();

/**
* The source line where the data table type is defined.
* Example: com/example/app/Cucumber.test():42
*
* @param detail true if extra detailed location information should be included.
* @return The source line of the step definition.
*/
String getLocation(boolean detail);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,8 @@
import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public interface DefaultDataTableCellTransformerDefinition {
public interface DefaultDataTableCellTransformerDefinition extends Located {

TableCellByTypeTransformer tableCellByTypeTransformer();

/**
* The source line where the default data table cell is defined.
* Example: com/example/app/Cucumber.test():42
*
* @param detail true if extra detailed location information should be included.
* @return The source line of the step definition.
*/
String getLocation(boolean detail);

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@
import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public interface DefaultDataTableEntryTransformerDefinition {
public interface DefaultDataTableEntryTransformerDefinition extends Located {

boolean headersToProperties();

TableEntryByTypeTransformer tableEntryByTypeTransformer();

/**
* The source line where the default table entry transformer is defined.
* Example: com/example/app/Cucumber.test():42
*
* @param detail true if extra detailed location information should be included.
* @return The source line of the step definition.
*/
String getLocation(boolean detail);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@
import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public interface DefaultParameterTransformerDefinition {
public interface DefaultParameterTransformerDefinition extends Located{

ParameterByTypeTransformer parameterByTypeTransformer();

/**
* The source line where the default parameter transformer is defined.
* Example: com/example/app/Cucumber.test():42
*
* @param detail true if extra detailed location information should be included.
* @return The source line of the step definition.
*/
String getLocation(boolean detail);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@
import org.apiguardian.api.API;

@API(status = API.Status.EXPERIMENTAL)
public interface DocStringTypeDefinition {
public interface DocStringTypeDefinition extends Located{

DocStringType docStringType();

/**
* The source line where the parameter type is defined.
* Example: com/example/app/Cucumber.test():42
*
* @param detail true if extra detailed location information should be included.
* @return The source line of the step definition.
*/
String getLocation(boolean detail);
}
13 changes: 2 additions & 11 deletions core/src/main/java/io/cucumber/core/backend/HookDefinition.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
package io.cucumber.core.backend;

import io.cucumber.core.api.Scenario;
import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public interface HookDefinition {
/**
* The source line where the step definition is defined.
* Example: foo/bar/Zap.brainfuck:42
*
* @param detail true if extra detailed location information should be included.
* @return The source line where the step definition is defined.
*/
String getLocation(boolean detail);
public interface HookDefinition extends Located {

void execute(Scenario scenario) throws Throwable;
void execute(TestCaseState state);

String getTagExpression();

Expand Down
23 changes: 23 additions & 0 deletions core/src/main/java/io/cucumber/core/backend/Located.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.cucumber.core.backend;

import org.apiguardian.api.API;

@API(status = API.Status.STABLE)
public interface Located {

/**
* @param stackTraceElement The location of the step.
* @return Return true if this matches the location. This is used to filter
* stack traces.
*/
boolean isDefinedAt(StackTraceElement stackTraceElement);

/**
* The source line where the step definition is defined.
* Example: com/example/app/Cucumber.test():42
*
* @return The source line of the step definition.
*/
String getLocation();

}
Loading