Hi Simon,

you should not rely on the order in which the steps methods are declared for the matching.

The method signatures are retrieved by the Class.getMethods() and the JRE may return them in different order.

The easiest way is to avoid the issue is to ensure that the step pattern match uniquely, but if that's not an option (sometimes it isn't if you want effective communication of behaviour) then you need to prioritise them:

http://jbehave.org/reference/stable/prioritising-steps.html

With the default strategy you can add a positive priority to the step that you want matched first:

@Then(value="the base currency reported by the configuration service is empty", priority=1) @Then("the base currency reported by the configuration service is $currency")

Another strategy is based on the http://en.wikipedia.org/wiki/Levenshtein_distance.

Else, you can provide your own prioritisation strategy.

Cheers

On Wed Sep 19 10:35:45 2012, Simon Kent wrote:
We have just found a small issue when moving up to Java 7 from Java 6.
We are using JBehave 3.6.2.

Consider the 2 steps below:


    @Then("the base currency reported by the configuration service*is
empty*")
    public void theBaseCurrencyIsEmpty() {

and
    @Then("the base currency reported by the configuration service*is
$currency*")
    public void theBaseCurrencyIs(final String currency) {

and the line to be interpreted "the base currency reported by the
configuration service is empty"

Under Java 6, this would always result in the 1st method being
executed which is what we would expect. Under Java 7, the 2nd method
is executed. Would have thought it should look for the specific
literal text before attempting to match with parameterisation?

Regards

Simon Kent
--
Simon Kent
QA Engineer
Gresham Computing PLC
e:[email protected]

------------------------------------------------------------------------
Privileged or confidential information may be contained in this
message. If you are not the addressee of this message please notify
the sender by return and thereafter delete the message, and you may
not use, copy, disclose or rely on the information contained in it.
Internet e-mail may be susceptible to data corruption, interception
and unauthorised amendment for which Gresham does not accept
liability. Whilst we have taken reasonable precautions to ensure that
this e-mail and any attachments have been swept for viruses, Gresham
does not accept liability for any damage sustained as a result of
viruses. Statements in this message that do not relate to the business
of Gresham are neither given nor endorsed by the company or its
directors. Gresham Computing plc Registered in England and Wales.
Company No. 01072032 Registered Office: Sopwith House, Brook Avenue,
Warsash, Southampton. Hants. SO31 9ZA Further information about
Gresham Computing can be found on our website: www.gresham-computing.com




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

   http://xircles.codehaus.org/manage_email


Reply via email to