I am using JBehave in a project where we test http requests to web services. This has worked beautifully so far. Now the team is introducing a new front end using JMS. It is designed to work as a secondary front end to the existing web services.

For example, a customer can post a request directly to the web service via http GET or POST, or alternatively submit a message to the JMS service, which then will submit an http GET or POST to the web service. The JMS service gives us the ability to prioritize and pre/post-process requests, which is why it is being introduced.

I built the tests so that we have a collection of story files & a single steps file. The steps file includes the following:

public class StepsFile {
    MyService service;
    ServiceBuilder serviceBuilder;
    [a collection of @Given, @When, @Then methods]
}

The ServiceBuilder generates the service object at the appropriate time during testing. 'service' is then queried for results (within @Then steps).

Now that we need to handle two variations of MyService (http and JMS), can I configure JBehave to run thru the same stories twice, but injecting different versions of ServiceBuilder in to the StepsFile class for each iteration? Is there a better way to handle this kind of implementation variation?


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

   http://xircles.codehaus.org/manage_email


Reply via email to