Cucumber-JVM: Scenario Outlines and pretty formatting

367 views
Skip to first unread message

Robert

unread,
Nov 16, 2011, 9:34:36 AM11/16/11
to cu...@googlegroups.com
There appears to be an issue with running Scenario Outlines using the pretty format feature.  The test passes if I use the progress switch.  Here is what I'm seeing when I run my test

Scenario Outline: This is an example of a scenario outline # /hello.feature:22
[WARNING] 
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
        at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
        at java.util.regex.Matcher.reset(Matcher.java:291)
        at java.util.regex.Matcher.<init>(Matcher.java:211)
        at java.util.regex.Pattern.matcher(Pattern.java:888)
        at gherkin.formatter.PrettyFormatter.indent(PrettyFormatter.java:363)
        at gherkin.formatter.PrettyFormatter.printDescription(PrettyFormatter.java:355)
        at gherkin.formatter.PrettyFormatter.printStatement(PrettyFormatter.java:111)
        at gherkin.formatter.PrettyFormatter.match(PrettyFormatter.java:149)
        at cucumber.runtime.World.runStep(World.java:76)
        at cucumber.runtime.model.CucumberScenario.runStep(CucumberScenario.java:68)
        at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:46)
        at cucumber.runtime.model.CucumberScenarioOutline.run(CucumberScenarioOutline.java:38)
        at cucumber.runtime.Runtime.run(Runtime.java:101)
        at cucumber.runtime.Runtime.run(Runtime.java:93)
        at cucumber.cli.Main.run(Main.java:77)
        at cucumber.cli.Main.main(Main.java:63)
        ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------


I've setup my pom file to look like

                <executions>
                    <!-- Generate .cucumber/meta.json -->
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>cucumber.cli.Main</mainClass>
                            <arguments>
                                <argument>--format</argument>
                                <argument>pretty</argument>
                                <argument>--glue</argument>
                                <argument>org.stag.hello</argument>
                                <argument>.</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>

And, here is the scenario

Scenario Outline: This is an example of a scenario outline
Given this is a scenario outline
When we concatenate <string_1> with <string_2>
Then the combined string is <string_3>
Examples:
|string_1    | string_2    | string_3    |
| hello      | world       | hello world | 

aslak hellesoy

unread,
Nov 16, 2011, 9:46:16 AM11/16/11
to cu...@googlegroups.com
On Wed, Nov 16, 2011 at 2:34 PM, Robert <rest...@gmail.com> wrote:
> There appears to be an issue with running Scenario Outlines using the pretty
> format feature.

Yeah, the pretty formatter (which lives in gherkin) has bugs in the
Scenario Outline handling. I have registered this as a bug:
https://github.com/cucumber/gherkin/issues/146

Aslak

> --
> You received this message because you are subscribed to the Google Groups
> "Cukes" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cukes/-/SGAKbZLmVu0J.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to
> cukes+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cukes?hl=en.
>

Robert

unread,
Nov 16, 2011, 12:07:02 PM11/16/11
to cu...@googlegroups.com
 
On Wednesday, November 16, 2011 6:46:16 AM UTC-8, Aslak Hellesøy wrote:
On Wed, Nov 16, 2011 at 2:34 PM, Robert <rest...@gmail.com> wrote:
> There appears to be an issue with running Scenario Outlines using the pretty
> format feature.

Yeah, the pretty formatter (which lives in gherkin) has bugs in the
Scenario Outline handling. I have registered this as a bug:
https://github.com/cucumber/gherkin/issues/146

Aslak


Thanks, Aslak.  Along sort of the same line of thought, will the CLI also support the --no-color switch that is currently supported in the Ruby version of Cucumber?

 

aslak hellesoy

unread,
Nov 16, 2011, 12:18:55 PM11/16/11
to cu...@googlegroups.com
On Wed, Nov 16, 2011 at 5:07 PM, Robert <rest...@gmail.com> wrote:
>
> On Wednesday, November 16, 2011 6:46:16 AM UTC-8, Aslak Hellesøy wrote:
>>
>> On Wed, Nov 16, 2011 at 2:34 PM, Robert <rest...@gmail.com> wrote:
>> > There appears to be an issue with running Scenario Outlines using the
>> > pretty
>> > format feature.
>>
>> Yeah, the pretty formatter (which lives in gherkin) has bugs in the
>> Scenario Outline handling. I have registered this as a bug:
>> https://github.com/cucumber/gherkin/issues/146
>>
>> Aslak
>
> Thanks, Aslak.  Along sort of the same line of thought, will the CLI also
> support the --no-color switch that is currently supported in the Ruby

Only if someone implements it!

Aslak

> https://groups.google.com/d/msg/cukes/-/PjgS8FxHkWIJ.

Reply all
Reply to author
Forward
0 new messages