cumcumber-jvm maven formatters

566 views
Skip to first unread message

Jason N.

unread,
Dec 5, 2011, 1:27:25 AM12/5/11
to Cukes
Simple question...

I'm running the latest cucumber-jvm and I'm wondering how you can tell
maven to use a specific formatter? I'm also running this in eclipse,
and whilst running it with the JUnit runner is ok, I would also like
some output in the console.

Is there a way to do this? I did notice there are formatters defined
in the project.

Cheers,
Jason

Cedric Lamalle

unread,
Dec 5, 2011, 7:02:48 AM12/5/11
to cu...@googlegroups.com
Hi Jason,
To choose a specific formatter you can define the system property 'cucumber.reporter' in your pom, for the standard formatter you can use:
progress
html
json
pretty
If you want monochrome output for the Pretty Formtter (pretty) you can set the system property 'cucumber.monochrome' to true.
Cheers,
Cédric.

2011/12/5 Jason N. <jaso...@gmail.com>

--
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+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.


Robert

unread,
Dec 5, 2011, 8:38:11 PM12/5/11
to cu...@googlegroups.com
Hi Cedric,

I'm using cucumber-jvm (v 1.0.0.RC2-SNAPSHOT).  I attempted to use the 'html' format by updating my POM file with

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <mainClass>cucumber.cli.Main</mainClass>
                            <arguments>
                                <argument>--format</argument>
                                <argument>html</argument>
                                <argument>--glue</argument>
                                <argument>org.stag.stepdefs</argument>
                                <argument>.</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

And, it produces the following exception.  Am I doing something wrong here? I suspect I am.

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.RuntimeException: java.io.IOException: Stream closed
        at gherkin.formatter.NiceAppendable.close(NiceAppendable.java:62)
        at cucumber.formatter.HTMLFormatter.close(HTMLFormatter.java:105)
        at cucumber.cli.Main.run(Main.java:77)
        at cucumber.cli.Main.main(Main.java:62)
        ... 6 more
Caused by: java.io.IOException: Stream closed
        at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:98)
        at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:108)
        at java.io.BufferedWriter.flush(BufferedWriter.java:235)
        at gherkin.formatter.NiceAppendable.close(NiceAppendable.java:56)
        ... 9 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Cedric Lamalle

unread,
Dec 5, 2011, 8:50:46 PM12/5/11
to cu...@googlegroups.com
Hi Robert,
Your configuration is ok, this is a bug, the underlying stream is closed twice, see https://github.com/cucumber/cucumber-jvm/issues/105. I hope I'll have some time next week to work on this.
Cédric.

2011/12/5 Robert <rest...@gmail.com>

--
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/-/3V36IG7V450J.
Reply all
Reply to author
Forward
0 new messages