HTMLFormatter Constructor arguments invalid in RC21 #269

Closed
hutchy2570 opened this Issue Mar 20, 2012 · 5 comments

Projects

None yet

2 participants

@hutchy2570

I try and run our suite of tests which use the HTMLFormatter output and the following exception is thrown.

Exception in thread "main" cucumber.runtime.CucumberException: class cucumber.formatter.HTMLFormatter must have a single-argument constructor that takes one of the following: [interface java.lang.Appendable, class java.io.File]
        at cucumber.formatter.FormatterConverter.instantiate(FormatterConverter.java:75)
        at cucumber.formatter.FormatterConverter.convert(FormatterConverter.java:49)
        at cucumber.formatter.FormatterConverter.convert(FormatterConverter.java:21)
        at com.beust.jcommander.JCommander.convertToList(JCommander.java:1183)
        at com.beust.jcommander.JCommander.convertValue(JCommander.java:1156)
        at com.beust.jcommander.JCommander.convertValue(JCommander.java:1078)
        at com.beust.jcommander.ParameterDescription.addValue(ParameterDescription.java:233)
        at com.beust.jcommander.ParameterDescription.addValue(ParameterDescription.java:200)
        at com.beust.jcommander.JCommander.processFixedArity(JCommander.java:740)
        at com.beust.jcommander.JCommander.parseValues(JCommander.java:622)
        at com.beust.jcommander.JCommander.parse(JCommander.java:274)
        at com.beust.jcommander.JCommander.parse(JCommander.java:257)
        at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:49)
        at cucumber.cli.Main.run(Main.java:18)
        at cucumber.cli.Main.main(Main.java:14)

We run from the maven exec plugin with the following config:

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <phase>integration-test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>java</executable>
                  <arguments>
                    <argument>-Denv=${env}</argument>
                    <argument>-classpath</argument>
                    <classpath />
                    <argument>cucumber.cli.Main</argument>
                    <argument>${project.basedir}/target/classes/features/released</argument>
                    <argument>--glue</argument>
                    <argument>com.project.test.acceptance</argument>
                    <argument>--format</argument>
                    <argument>pretty</argument>
                    <argument>--format</argument>
                    <argument>html</argument>
                    <argument>--out</argument>
                    <argument>${project.basedir}/target</argument>
                    <argument>--tags</argument>
                    <argument>~@wip</argument>
                    <argument>--tags</argument>
                    <argument>~@broken</argument>
                    <argument>--tags</argument>
                    <argument>~@broken-${env}</argument>
                    <argument>--tags</argument>
                    <argument>~@ignore</argument>
                    <argument>--tags</argument>
                    <argument>~@deferred</argument>
                    <argument>--tags</argument>
                    <argument>~@sprint1</argument>
                    <argument>--tags</argument>
                    <argument>~@sprint2</argument>
                    <argument>--tags</argument>
                    <argument>~@sprint3</argument>
                    <argument>--tags</argument>
                    <argument>~@sprint4</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>

@aslakhellesoy
Cucumber member

Instead of:

<argument>--format</argument>
<argument>html</argument>
<argument>--out</argument>
<argument>${project.basedir}/target</argument>

Can you try:

<argument>--format</argument>
<argument>html:${project.basedir}/target</argument>
@aslakhellesoy
Cucumber member

If that works, I'll still keep this ticket open - the error message should have told you what you need to do.

@hutchy2570

Yes, that works. Thanks.

@aslakhellesoy
Cucumber member

Related to #148

@aslakhellesoy
Cucumber member

This was fixed in 1.0.0.RC24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment