cucumber.runtime.CucumberException: Arity mismatch. Declared parameters: [class java.lang.Object]. Matched arguments: []

501 views
Skip to first unread message

Paul

unread,
Apr 11, 2012, 12:16:21 PM4/11/12
to cu...@googlegroups.com
Hi there,

I'm trying to migrate from cuke4duke to cucumber-jvm.  I'm trying to run the tests via Junit, using groovy step definitions. 

I've got very close, but I get this for most of my steps:

cucumber.runtime.CucumberException: Arity mismatch. Declared parameters: [class java.lang.Object]. Matched arguments: []
    at cucumber.runtime.StepDefinitionMatch.transformedArgs(StepDefinitionMatch.java:69)
    at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:43)
    at cucumber.runtime.Runtime.runStep(Runtime.java:223)
    at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
    at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
    at cucumber.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:76)
    at cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:65)
    at cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:20)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at cucumber.junit.FeatureRunner.run(FeatureRunner.java:72)
    at cucumber.junit.Cucumber.runChild(Cucumber.java:75)
    at cucumber.junit.Cucumber.runChild(Cucumber.java:36)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at cucumber.junit.Cucumber.run(Cucumber.java:80)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:182)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

An example step is:

   @357
    Scenario: Carbon Coder executes unsuccessfully
        Given Carbon Coder is running correctly
        ...

And the step definition :

Given(~"Carbon Coder is running correctly\$") {
    transcodeHelper.prepareService()
}

Any ideas for me??

Thanks,
Paul

aslak hellesoy

unread,
Apr 11, 2012, 12:27:24 PM4/11/12
to cu...@googlegroups.com

What version?

> Thanks,
> Paul
>
> --
> 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.

Paul

unread,
Apr 11, 2012, 12:29:12 PM4/11/12
to cu...@googlegroups.com
1.0.2

On 11 April 2012 17:27, aslak hellesoy <aslak.h...@gmail.com> wrote:
What version?

Paul

unread,
Apr 11, 2012, 12:44:32 PM4/11/12
to cu...@googlegroups.com
It works if I add a regex to the step definition.  e.g.

Given(~"Carbon Coder (*.) running correctly\$") { String ignore ->
    transcodeHelper.
    prepareService()
 }

aslak hellesoy

unread,
Apr 11, 2012, 12:47:28 PM4/11/12
to cu...@googlegroups.com
On Wed, Apr 11, 2012 at 5:44 PM, Paul <el.pabl...@gmail.com> wrote:
> It works if I add a regex to the step definition.  e.g.
>
> Given(~"Carbon Coder (*.) running correctly\$") { String ignore ->
>     transcodeHelper.
>     prepareService()
>  }
>
>

Please register a ticket on github. Not convinced it is a bug, but at
least the error message should be better!

Aslak

> On 11 April 2012 17:29, Paul <el.pabl...@gmail.com> wrote:
>>
>> 1.0.2
>>
>> On 11 April 2012 17:27, aslak hellesoy <aslak.h...@gmail.com> wrote:
>>>
>>> What version?
>>
>>
>

Reply all
Reply to author
Forward
0 new messages