I had this in a real-life scenario maybe once (same step as normal parameter and as example table column and solved it with a wrapper function), maybe your perception of limiting is different from mine.
Anyway, you are free to propose an improvement as Mauro mentioned, so you can provide a better solution. On 19.09.2014 19:50, Anders wrote: > If I need to add a new step implementation method (“wrapper”) for each > name that the examples table column might have, then I think it /is/ > limiting reuse. > > (by making it harder than it need to be, and by making it less maintainable) > > > > Cheers > > > > > > *From:*Alexander Lehmann > [mailto:alexl...@gmail.com] > *Sent:* den 19 september 2014 16:45 > *To:* user@jbehave.codehaus.org > *Subject:* Re: [jbehave-user] Parametrised scenario problem > > > > Basically it is not limiting reuse, it just requires a 1-line wrapper > > @Then("should see <message>") > > *public**void*shouldSeeMsg(@Named("message")String message) > > { > > // check text… > > // check text… > > // check text… > > } > > @Then("should see <message1>") > > *public**void*shouldSeeMsg1(@Named("message1")String message) > > { > > shouldSeeMsg(message); > > } > > > > On Fri, Sep 19, 2014 at 4:12 PM, Anders > <codeh...@aek.se > <mailto:codeh...@aek.se>> wrote: > > I would argue that this is a serious bug, a bug that has been there > for a long time. > > This strange “lock down” of parameter names when using example > tables has annoyed me for a long time. > > This bug is seriously limiting the reusability of step methods. > > > > Is there an issue for this in Jira that we can vote on? > > > > > > *From:*Zheng, Ayesha(AWF) > [mailto:xuzh...@ebay.com > <mailto:xuzh...@ebay.com>] > *Sent:* den 19 september 2014 11:24 > *To:* user@jbehave.codehaus.org > <mailto:user@jbehave.codehaus.org> > *Subject:* [jbehave-user] Parametrised scenario problem > > > > Hi all, > > > > I have a scenario: > > > > Given a user open homepage > > Then should see <message1> > > When user do something and go to another page > > Then should see <message2> > > *Examples:* > > test.table > > > > > > And test.table with content: > > |message1|message2| > > |Welcome|Hello| > > > > And step “Then should see <message1>” and “Then should see > <message2>” do the same thing: just check the text. > > So I just want to implement it once time. > > Code like: > > @Then("should see <message>") > > *public**void*shouldSeeMsg(@Named("message")String message) > > { > > // check text… > > } > > > > When running this case, I hope it can match both step “<message1>” > and “<message2>”. > > But the problem is, I found the parameter name in code must be the > same with the name specified in scenario. > > These steps always in PENDING status. > > > > Could anyone help to how to solve this? > > Thanks very much. > > > > Best Regards, > > Ayesha > > > > > > > -- > > Alexander Lehmann <alexl...@gmail.com > <mailto:alexl...@gmail.com>> > > http://about.me/alexlehm > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email