cucumber-attic / gherkin2

A fast Gherkin parser in Ragel (The parser behind Cucumber)
MIT License
382 stars 221 forks source link

cucumber for java: number format exception when using tag with semicolon in name #341

Closed DemianTinkiel closed 6 years ago

DemianTinkiel commented 8 years ago

I have a feature file annotated as

 @issue:OVD-821. 
 Feature: Some feature text

When I run

mvn clean verify -Dcucumber.options="--tags @issue:OVD-821"

I get

java.lang.NumberFormatException: For input string: "OVD-821"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at gherkin.TagExpression.add(TagExpression.java:47)
        at gherkin.TagExpression.<init>(TagExpression.java:17)
        at gherkin.formatter.TagFilter.<init>(TagFilter.java:14)
        at gherkin.formatter.FilterFormatter.detectFilter(FilterFormatter.java:64)
        at gherkin.formatter.FilterFormatter.<init>(FilterFormatter.java:41)
        at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:126)
        at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:102)
        at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54)
        at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34)
        at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:201)
        at cucumber.api.junit.Cucumber.<init>(Cucumber.java:60)
        at net.serenitybdd.cucumber.CucumberWithSerenity.<init>(CucumberWithSerenity.java:26)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
        at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
        at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
        at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
        at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
        at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
aslakhellesoy commented 8 years ago

We're in the process of migrating all cucumbers to gherkin3, where this problem will not occur.

We're not likely to fix the bug in gherkin2 (this repo).

I don't have an ETA for when cucumber-jvm will use gherkin3, but we're working on it.

DemianTinkiel commented 8 years ago

I understand. Thanks for letting me know. Would you have a workaround? On 13 Nov 2015 9:07 pm, "Aslak Hellesøy" notifications@github.com wrote:

We're in the process of migrating all cucumbers to gherkin3 https://github.com/cucumber/gherkin3, where this problem will not occur.

We're not likely to fix the bug in gherkin2 (this repo).

I don't have an ETA for when cucumber-jvm will use gherkin3, but we're working on it.

— Reply to this email directly or view it on GitHub https://github.com/cucumber/gherkin/issues/341#issuecomment-156557062.

aslakhellesoy commented 8 years ago

Would you have a workaround?

Don't use a colon in your tags ;-)

link89 commented 6 years ago

@aslakhellesoy Hi, I get stuck on this issue recently. I find it still exists on cucumber-jvm 1.2.4. Which release uses gherkin3 as you had mentioned? Should we upgrade to cucumber 2 to solve this problem?

aslakhellesoy commented 6 years ago

Cucumber-JVM 1.2.4 is 2.5 years old. We won't make any more releases to the 1.2 series.

Please upgrade to 2.x