Skip to content

Commit 3336a97

Browse files
authored
Improve documentation and comments (#2785)
1 parent 0a0f173 commit 3336a97

File tree

22 files changed

+130
-133
lines changed

22 files changed

+130
-133
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We appreciate that. Do keep the following in mind:
44

5-
* Before making significant contribution consider discussing the outline of
5+
* Before making a significant contribution, consider discussing the outline of
66
your solution first. This may avoid a duplication of efforts.
77
* When you send a [pull requests](https://help.github.com/articles/using-pull-requests),
88
please include tests to go along with it.
@@ -25,7 +25,7 @@ When building the project for the first time, run:
2525
The `cucumber-archetype` modules integration tests against `-SNAPSHOT`
2626
versions of Cucumber. These must be installed first.
2727

28-
Afterwards `./mvnw test` or `./mvnw verify` should work as expected.
28+
Afterward `./mvnw test` or `./mvnw verify` should work as expected.
2929

3030
## Formatting Java
3131

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Cucumber-JVM also integrates with all the popular
2222

2323
## Upgrading?
2424

25-
Migration instructions from previous major version and a long form
25+
Migration instructions from previous major versions and a long form
2626
explanation of noteworthy changes can be found in the [release-notes archive](release-notes)
2727

2828
The changes for the current major version can be found in the [CHANGELOG.md](CHANGELOG.md).

cucumber-bom/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Bill of Materials
22

33
It is fairly common for one project to use more than one Cucumber dependency. To
4-
keep these version in sync a Bill of Materials can be used.
4+
keep these versions in sync, a Bill of Materials can be used.
55

66
## Usage
77

cucumber-cdi2/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Cucumber CDI 2
22
==============
33

4-
Use CDI Standalone Edition (CDI SE) API to provide dependency injection in to
5-
steps definitions
4+
Use CDI Standalone Edition (CDI SE) API to provide dependency injection into
5+
steps definitions.
66

77
Add the `cucumber-cdi2` dependency to your pom.xml:
88

@@ -48,7 +48,7 @@ And for Weld it is:
4848

4949
## Usage
5050

51-
For each scenario a new CDI container is started. If not present in the
51+
For each scenario, a new CDI container is started. If not present in the
5252
container, step definitions are added as unmanaged beans and dependencies are
5353
injected.
5454

cucumber-core/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Cucumber Core
44
Provides components needed to discover, parse and execute feature files. The
55
core is designed with a few extension systems and plugin points. You
66
typically don't depend directly on `cucumber-core` but rather use the different
7-
submodules together e.g. `cucumber-junit` and `cucumber-java`.
7+
submodules together e.g. `cucumber-junit` and `cucumber-java`.
88

99
## Properties, Environment variables, System Options ##
1010

@@ -79,7 +79,7 @@ Each property also has an `UPPER_CASE` and `snake_case` variant. For example
7979
## Backend ##
8080

8181
Backends consist of two components: a `Backend`, and an optional `ObjectFactory`.
82-
They are respectively responsible for discovering glue classes, registering
82+
They are respectively responsible for discovering glue classes, registering
8383
step definitions, and creating instances of said glue classes. Backend and
8484
object factory implementations are discovered via SPI.
8585

@@ -96,13 +96,13 @@ An event has a UUID. The UUID generator can be configured using the `cucumber.uu
9696
| io.cucumber.core.eventbus.RandomUuidGenerator | Thread-safe, collision-free, multi-jvm | ~1 | Reports may be generated on different JVMs at the same time. A typical example would be one suite that tests against Firefox and another against Safari. The exact browser is configured through a property. These are then executed concurrently on different Gitlab runners. |
9797
| io.cucumber.core.eventbus.IncrementingUuidGenerator | Thread-safe, collision-free, single-jvm | ~130 | Reports are generated on a single JVM |
9898

99-
The performance gain on real project depend on the feature size.
99+
The performance gain on real projects depends on the feature size.
100100

101101
When not specified, the `RandomUuidGenerator` is used.
102102

103103
## Plugin ##
104104

105-
By implementing the Plugin interface classes can listen to execution events
105+
By implementing the Plugin interface, classes can listen to execution events
106106
inside Cucumber JVM. Consider using a Plugin when creating test execution reports.
107107

108108
## FileSystem ##

cucumber-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@
194194
<executions>
195195
<execution>
196196
<!-- the cucumber-* dependencies of cucumber-core are
197-
non-trivial. This ensures that we not forget to
198-
update all intermediate dependencies. For instance
197+
non-trivial. This ensures that we do not forget to
198+
update all intermediate dependencies. For instance,
199199
when updating messages -->
200200
<id>enforce-dependency-convergence</id>
201201
<configuration>

cucumber-core/src/main/java/io/cucumber/core/options/PluginOption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private static Class<? extends Plugin> parsePluginName(String pluginSpecificatio
125125
throw createPluginIsNotCompatible(pluginSpecification);
126126
}
127127

128-
// Replace IDEA plugin with TeamCity
128+
// Replace IntelliJ IDEA plugin with TeamCity
129129
if (INCOMPATIBLE_INTELLIJ_IDEA_PLUGIN_CLASSES.contains(pluginName)) {
130130
log.debug(() -> "Incompatible IntelliJ IDEA Plugin detected. Falling back to teamcity plugin");
131131
return TeamCityPlugin.class;

cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ public class TeamCityPlugin implements EventListener {
131131

132132
@SuppressWarnings("unused") // Used by PluginFactory
133133
public TeamCityPlugin() {
134-
// This plugin prints markers for Team City and IDEA that allows them
135-
// associate the output to specific test cases. Printing to system out
136-
// - and potentially mixing with other formatters - is intentional.
134+
// This plugin prints markers for Team City and IntelliJ IDEA that
135+
// allows them to associate the output to specific test cases. Printing
136+
// to system out - and potentially mixing with other formatters - is
137+
// intentional.
137138
this(System.out);
138139
}
139140

cucumber-deltaspike/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Cucumber DeltaSpike
44
This module relies on [DeltaSpike Container Control](https://deltaspike.apache.org/documentation/container-control.html) to start/stop supported CDI container.
55

66
## Setup
7-
Enable cdi support for your steps by adding a (empty) beans.xml into your classpath (src/main/resource/META-INF for normal classes or src/test/resources/META-INF for test classes):
7+
Enable cdi support for your steps by adding an (empty) beans.xml into your classpath (src/main/resource/META-INF for normal classes or src/test/resources/META-INF for test classes):
88

99
```xml
1010
<beans xmlns="http://java.sun.com/xml/ns/javaee"
@@ -16,7 +16,7 @@ Enable cdi support for your steps by adding a (empty) beans.xml into your classp
1616
</beans>
1717
```
1818

19-
To use DependencyInjection add `@Inject` to any field which should be managed by CDI, for more information see [JSR330](https://www.jcp.org/en/jsr/detail?id=330).
19+
To use dependency injection, add `@Inject` to any field which should be managed by CDI. For more information, see [JSR330](https://www.jcp.org/en/jsr/detail?id=330).
2020

2121
```java
2222
public class BellyStepdefs {
@@ -28,13 +28,13 @@ public class BellyStepdefs {
2828
}
2929
```
3030

31-
This ObjectFactory doesn't start or stop any [Scopes](https://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html), so all beans live inside the default scope (Dependent). Now cucumber requested a instance of your stepdefinitions for every step, which means cdi create a new instance for every step and for all injected fields. This behaviour makes it impossible to share a state inside a szenario.
31+
This object factory doesn't start or stop any [Scopes](https://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html), so all beans live inside the default scope (Dependent). Now Cucumber requested an instance of your step definitions for every step, which means cdi create a new instance for every step and for all injected fields. This behaviour makes it impossible to share a state inside a scenario.
3232

33-
To bybass this, you must annotate your class(es) with `@javax.inject.Singleton`:
34-
1. on stepdefintions: now the ojectfactory will create only one instance include injected fields per scenario and both injected fields and stepdefinitions can be used to share state inside a scenario.
35-
2. on any other class: now the objectfactory will create a new instance of your stepdefinitions per step and stepdefinitions can not be used to share state inside a scenario, only the annotated classes can be used to share state inside a scenario
33+
To bypass this, you must annotate your class(es) with `@javax.inject.Singleton`:
34+
1. on destinations: now the object factory will create only one instance include injected fields per scenario, and both injected fields and step definitions can be used to share state inside a scenario.
35+
2. on any other class: now the object factory will create a new instance of your step definitions per step and step definitions can not be used to share state inside a scenario, only the annotated classes can be used to share state inside a scenario
3636

37-
you can also combine both approaches.
37+
You can also combine both approaches.
3838

3939
```java
4040
@Singleton
@@ -46,9 +46,9 @@ public class BellyStepdefs {
4646
//normal step code ...
4747
}
4848
```
49-
It is not possible to use any other scope than Dependent this means alsoi it is not possible to share a state over two or more scenarios, every scenario start with a clean environment.
49+
It is not possible to use any other scope than Dependent. This means also it is not possible to share a state over two or more scenarios; every scenario starts with a clean environment.
5050

51-
To enable this objectfactory add the following dependency to your classpath:
51+
To enable this object factory, add the following dependency to your classpath:
5252
```xml
5353
<dependency>
5454
<groupId>io.cucumber</groupId>
@@ -60,7 +60,7 @@ To enable this objectfactory add the following dependency to your classpath:
6060

6161
and one of the supported cdi-containers.
6262

63-
to use it with Weld:
63+
To use it with Weld:
6464

6565
```xml
6666
<dependency>
@@ -77,7 +77,7 @@ to use it with Weld:
7777
</dependency>
7878
```
7979

80-
or to use it with OpenEJB:
80+
To use it with OpenEJB:
8181

8282
```xml
8383
<dependency>
@@ -106,7 +106,8 @@ or to use it with OpenEJB:
106106
</dependency>
107107
```
108108

109-
or to use it with OpenWebBeans:
109+
To use it with OpenWebBeans:
110+
110111
```xml
111112
<dependency>
112113
<groupId>org.apache.deltaspike.cdictrl</groupId>
@@ -128,4 +129,4 @@ or to use it with OpenWebBeans:
128129
</dependency>
129130
```
130131

131-
Some containers need that you provide a CDI-API in a given version, but if you develop CDI and use one of the above containers it should already on your path.
132+
Some containers need you to provide a CDI-API in a given version, but if you develop CDI and use one of the above containers, it should already be on your path.

cucumber-guice/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ singleton and 'no scope'.
3232

3333
### Version 1.1.8 onwards
3434
A Guice injector is created once before any tests are run and is destroyed
35-
after the last test has run. Before each test scenario a new scenario scope
35+
after the last test has run. Before each test scenario, a new scenario scope
3636
is created. At the end of the test scenario the scenario scope is destroyed.
3737
Singleton scope exists throughout all test scenarios.
3838

@@ -48,7 +48,7 @@ their singleton bindings updated. All bindings in
4848
By including the `cucumber-guice` jar on your
4949
`CLASSPATH` your Step Definitions will be instantiated by Guice.
5050
There are two main modes of using the module: with [scope annotations](#scoping-your-step-definitions) and with
51-
[module bindings](#using-module-bindings). The two modes can also be mixed. When mixing modes it is
51+
[module bindings](#using-module-bindings). The two modes can also be mixed. When mixing modes, it is
5252
important to realise that binding a class in a scope in a module takes
5353
precedence if the same class is also bound using a scope annotation.
5454

@@ -78,7 +78,7 @@ be absolutely sure that a state change in one scenario could not possibly
7878
influence the success or failure of a subsequent scenario. As an example of
7979
when you might use a singleton, imagine you have an http client that is
8080
expensive to create. By holding a reference to the client in a class bound in
81-
singleton scope you can reuse the client in multiple scenarios.
81+
singleton scope, you can reuse the client in multiple scenarios.
8282

8383
#### Using scope annotations
8484
This is the easy route if you're new to Guice. To bind a class in scenario
@@ -107,7 +107,7 @@ public class ScenarioScopedSteps {
107107
To bind a class in singleton scope add the
108108
`javax.inject.Singleton` annotation to the class definition. One
109109
strategy for using stateless step definitions is to use providers to share
110-
stateful scenario scoped instances between stateless singleton step
110+
stateful scenario-scoped instances between stateless singleton step
111111
definition instances. For example:
112112

113113
```java
@@ -136,7 +136,7 @@ There is an alternative explanation of using [providers for mixing scopes](https
136136
### Using module bindings
137137
As an alternative to using annotations you may prefer to declare Guice
138138
bindings in a class that implements `com.google.inject.Module`. To
139-
do this you should create a class that implements
139+
do this, you should create a class that implements
140140
`io.cucumber.guice.api.InjectorSource`. This gives you complete
141141
control over how you obtain a Guice injector and it's Guice modules. The
142142
injector must provide a binding for

0 commit comments

Comments
 (0)