Hi,

I just found out that there is a serious bug with regard to how candidate steps are handled, and the weird part is that it seems to be intentional.

Here's the problem: if in my Step class I have the following methods
@Given("foo named $name")
public void givenFoo(String name) {...}
@When("foo named $name is created")
public void whenFooIsCreated(String name) {...}

and then use these in my scenarios:
Given foo named Bar
...
When foo named Xyzzy is created
---
I would *expect* that the annotations are used so that "When foo named Xyzzy is created" cannot match the @Given method. But, this is not the case. It seems like I can use any annotation on the methods, and it will be the same. The above could be defined with:
@Given("foo named $name")
public void givenFoo(String name) {...}
@Given("foo named $name is created")
public void whenFooIsCreated(String name) {...}

and it would be working the same way.

This causes me a lot of problems, because with the above I may randomly get givenFoo("Xyzzy is created") being invoked. And it is entirely random; sometimes it works, sometimes it doesn't. I'm assuming there's a hashmap somewhere that causes this randomness. And randomness is what I'm looking for in a test framework, if you see what I mean.

So, first question: what is the intention behind not caring about the specific annotation being used on the methods?

Second question: can this be changed so that the annotations matter?

thanks, Rickard

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to