Skip to content

Commit 6045294

Browse files
committed
Merge pull request #557 from brasmusson/all-steps-first-execution
Merge pull request #557 Make the PrettyFormatter work by revering to all-steps-first execution. This fixes #491 and the other reports of IndexOutOfBoundsException when using the PrettyFormatter. Update the History.md
2 parents 3fab1a4 + 1622c69 commit 6045294

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

History.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* [Core] Throw exception when unsupported command line options are used. ([#482](https://github.com/cucumber/cucumber-jvm/pull/482), [#463](https://github.com/cucumber/cucumber-jvm/issues/463) Klaus Bayrhammer)
1818
* [Scala] Release cucumber-scala for the two most recent minor releases (currently 2.10.2 and 2.9.3) ([#432](https://github.com/cucumber/cucumber-jvm/issues/432), [#462](https://github.com/cucumber/cucumber-jvm/pull/462) Chris Turner)
1919
* [Core] JUnitFormatter: Fix indentation, hook handling and support all-steps-first execution ([#556](https://github.com/cucumber/cucumber-jvm/pull/556) Björn Rasmusson)
20+
* [Core] Make the PrettyFormatter work by revering to all-steps-first execution ([#557](https://github.com/cucumber/cucumber-jvm/pull/557) Björn Rasmusson)
2021

2122
## [1.1.3](https://github.com/cucumber/cucumber-jvm/compare/v1.1.2...v1.1.3) (2013-03-10)
2223

core/src/main/java/cucumber/runtime/model/CucumberScenario.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void run(Formatter formatter, Reporter reporter, Runtime runtime) {
3737

3838
runBackground(formatter, reporter, runtime);
3939
format(formatter);
40-
runSteps(formatter, reporter, runtime);
40+
runSteps(reporter, runtime);
4141

4242
runtime.runAfterHooks(reporter, tags);
4343
runtime.disposeBackendWorlds();
@@ -46,7 +46,7 @@ public void run(Formatter formatter, Reporter reporter, Runtime runtime) {
4646
private void runBackground(Formatter formatter, Reporter reporter, Runtime runtime) {
4747
if (cucumberBackground != null) {
4848
cucumberBackground.format(formatter);
49-
cucumberBackground.runSteps(formatter, reporter, runtime);
49+
cucumberBackground.runSteps(reporter, runtime);
5050
}
5151
}
5252
}

core/src/main/java/cucumber/runtime/model/CucumberScenarioOutline.java

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public List<CucumberExamples> getCucumberExamplesList() {
3838
@Override
3939
public void run(Formatter formatter, Reporter reporter, Runtime runtime) {
4040
format(formatter);
41-
formatSteps(formatter);
4241
for (CucumberExamples cucumberExamples : cucumberExamplesList) {
4342
cucumberExamples.format(formatter);
4443
List<CucumberScenario> exampleScenarios = cucumberExamples.createExampleScenarios();

core/src/main/java/cucumber/runtime/model/StepContainer.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,18 @@ public void step(Step step) {
2929

3030
void format(Formatter formatter) {
3131
statement.replay(formatter);
32-
}
33-
34-
void formatSteps(Formatter formatter) {
3532
for (Step step : getSteps()) {
3633
formatter.step(step);
3734
}
3835
}
3936

40-
void runSteps(Formatter formatter, Reporter reporter, Runtime runtime) {
37+
void runSteps(Reporter reporter, Runtime runtime) {
4138
for (Step step : getSteps()) {
42-
runStep(step, formatter, reporter, runtime);
39+
runStep(step, reporter, runtime);
4340
}
4441
}
4542

46-
void runStep(Step step, Formatter formatter, Reporter reporter, Runtime runtime) {
47-
formatter.step(step);
43+
void runStep(Step step, Reporter reporter, Runtime runtime) {
4844
runtime.runStep(cucumberFeature.getUri(), step, reporter, cucumberFeature.getI18n());
4945
}
5046
}

0 commit comments

Comments
 (0)