[JVM] 1.1.3 breaks grails-cucumber plugin

31 views
Skip to first unread message

Martin Hauner

unread,
May 10, 2013, 9:54:06 AM5/10/13
to cu...@googlegroups.com
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

aslak hellesoy

unread,
May 10, 2013, 10:11:52 AM5/10/13
to Cucumber Users

We'll try to get that merged in for the next release.

Aslak
 
--
Martin

--
-- Rules --

1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
--- You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Martin Hauner

unread,
May 10, 2013, 11:08:36 AM5/10/13
to cu...@googlegroups.com
Hi,

On 10.05.13 16:11, aslak hellesoy wrote:
> There is a fix here: https://github.com/cucumber/gherkin/pull/252
>
> We'll try to get that merged in for the next release.
>
> Aslak

That was easy Thanks. Then I'll use 1.1.2.

--
Martin
Reply all
Reply to author
Forward
0 new messages