[
http://jira.codehaus.org/browse/JBEHAVE-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mauro Talevi updated JBEHAVE-196:
---------------------------------
Description:
Candidate steps should be aware of annotations @Given, @When and @Then and
distinguish pattern steps arising from different annotations.
At present, there is no such distinction and can lead to very confusing
behaviour.
Example:
@Given("foo named $name")
public void givenFoo(String name) {...}
@When("foo named $name is created")
public void createFoo{...}
If I have a scenario like this:
Scenario: Do stuff
Given xyz
When foo named Bar is created
...
then the "When" can match the givenFoo() method, which gets passed "Bar is
created" as parameter.
This unexpected behaviour, due to the implict uniqueness required of the
matching pattern across all annotations, causes randomness in test execution.
Sometimes it works, sometimes it doesn't. It would be better if the different
annotations where treated differently in the matching of patterns, so that when
I write Given/When/Then in the scenarios they will match corresponding
@Given/@When/@Then methods.
was:
In general, words should have meanings. For JBehave, if I use the annotations
@Given, @When and @Then, they should mean different things. Right now there is
no difference, which can lead to very confusing behaviour.
Example:
@Given("foo named $name")
public void givenFoo(String name) {...}
@When("foo named $name is created")
public void createFoo{...}
If I have a scenario like this:
Scenario: Do stuff
Given xyz
When foo named Bar is created
...
then the "When" can match the givenFoo() method, which gets passed "Bar is
created" as parameter.
This unexpected behaviour, due to words not having any meaning, causes
randomness in test execution. Sometimes it works, sometimes it doesn't. It
would be better if the different annotations had separate meanings, so that
when I write Given/When/Then in the scenarios they will match corresponding
@Given/@When/@Then methods.
Fix Version/s: 2.4
Issue Type: Improvement (was: Bug)
Summary: Candidate steps should be aware of the method annotation
type when matching textual steps (was: Words should have meanings)
Reworded to better express current behaviour and new feature requirement.
> Candidate steps should be aware of the method annotation type when matching
> textual steps
> -----------------------------------------------------------------------------------------
>
> Key: JBEHAVE-196
> URL: http://jira.codehaus.org/browse/JBEHAVE-196
> Project: JBehave
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.3
> Reporter: Rickard Oberg
> Fix For: 2.4
>
>
> Candidate steps should be aware of annotations @Given, @When and @Then and
> distinguish pattern steps arising from different annotations.
> At present, there is no such distinction and can lead to very confusing
> behaviour.
> Example:
> @Given("foo named $name")
> public void givenFoo(String name) {...}
> @When("foo named $name is created")
> public void createFoo{...}
> If I have a scenario like this:
> Scenario: Do stuff
> Given xyz
> When foo named Bar is created
> ...
> then the "When" can match the givenFoo() method, which gets passed "Bar is
> created" as parameter.
> This unexpected behaviour, due to the implict uniqueness required of the
> matching pattern across all annotations, causes randomness in test execution.
> Sometimes it works, sometimes it doesn't. It would be better if the different
> annotations where treated differently in the matching of patterns, so that
> when I write Given/When/Then in the scenarios they will match corresponding
> @Given/@When/@Then methods.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email