Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

com.beust.jcommander.ParameterException: Trouble running test with tags option #266

Closed
restagner opened this Issue · 6 comments

3 participants

@restagner

Cucumber-JVM version: 1.0.0.RC21
Modules: cucumber-picocontainer, cucumber-junit & cucumber-html
Executed the following JUnit test:

@RunWith(Cucumber.class)
@Cucumber.Options(features = {"features/"}, glue = {"com.twds.example.stepdefs"}, tags = {"@selenium"})
public class RunExampleTest {
}

Output from test

com.beust.jcommander.ParameterException: Could not read file selenium: java.io.FileNotFoundException: selenium (The system cannot find the file specified)
at com.beust.jcommander.JCommander.readFile(JCommander.java:463)
at com.beust.jcommander.JCommander.expandArgs(JCommander.java:338)
at com.beust.jcommander.JCommander.parse(JCommander.java:274)
at com.beust.jcommander.JCommander.parse(JCommander.java:257)
at cucumber.runtime.RuntimeOptions.(RuntimeOptions.java:49)
at cucumber.junit.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:27)
at cucumber.junit.Cucumber.(Cucumber.java:54)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Steps to reproduce

  1. add the 'tags' option to the Cucumber.Options annotation contained in the JUnit class
  2. add a tag to a feature file (place the tag at the scenario level) -- the name of the tag should match the one added in Step 1.
  3. run the test
@aslakhellesoy

I just ran into the same issue - I'll look into it

@aslakhellesoy

The culprit is here. It's common for many command line tools to use @ to refer to contents in a file.

We have 3 options:

1) Patch JCommander and wait for a new release
2) Don't use JCommander at all

I'll have to think about this.

@cbeust

For what it's worth, it would have been trivial for me to make this '@' parameter configurable.

@aslakhellesoy

@cbeust yeah I figured it would have been easy, but implementing our own parsing turned out to be just as simple :-)

@cbeust

Fair enough :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.