Hi,
moving from cucumber-jvm 1.1.2 to 1.1.3 breaks the grails-cucumber plugin. It
crashes in gherkins PrettyFormatter because of changes in 1.1.3.
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at gherkin.formatter.PrettyFormatter.indentedLocation(PrettyFormatter.java:142)
at gherkin.formatter.PrettyFormatter.printStep(PrettyFormatter.java:255)
at gherkin.formatter.PrettyFormatter.result(PrettyFormatter.java:199)
at gherkin.formatter.Reporter$result$0.call(Unknown Source)
at
grails.plugin.cucumber.PrettyFormatterWrapper.result(PrettyFormatterWrapper.groovy:101)
at gherkin.formatter.Reporter$result.call(Unknown Source)
at grails.plugin.cucumber.CucumberFormatter.result(CucumberFormatter.groovy:219)
at cucumber.runtime.Runtime.runStep(Runtime.java:280)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:49)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:43)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:112)
at cucumber.runtime.model.CucumberFeature$run.call(Unknown Source)
at grails.plugin.cucumber.Cucumber$_run_closure2.doCall(Cucumber.groovy:58)
at grails.plugin.cucumber.Cucumber.run(Cucumber.groovy:57)
I tracked it down to
https://github.com/cucumber/cucumber-jvm/commit/4fba53c89f206363004fb81893606f9bd7695c2f
StepContainer.java
I'm a bit confused about the change because it modifies the order of the method
calls on formatter/reporter.
In 1.1.2 and earlier it first called formatter.step() for all steps and then
reporter.match()/result() (via runtime.runStep()) for each step.
Now with 1.1.3 it is interleaving the calls: step(), match()/result(), step (),
match ()/result().
gherkins PrettyFormatter does not seem to like that.
The formatter in grails.plugin.cucumber just delegate down to gherkins
PrettyFormatter and I run the cucumber features like this:
grails.plugin.cucumber.Cucumber.run:
def run (CucumberFormatter formatter) {
features.each { CucumberFeature feature ->
feature.run (formatter, formatter, runtime)
}
//...
}
I would appreciate any comment if my analyses is correct or if I'm doing
something completely wrong here. :)
--
Martin