[ http://jira.codehaus.org/browse/JBEHAVE-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mauro Talevi updated JBEHAVE-148: --------------------------------- Description: Automated the process of writing the matching Java steps by auto-generating stubs for steps from template. It would involve defining a template of steps that specifies the name and type of the parameter (with a given convention, such as colon separated). So, e.g. Given a condition $condition:Condition When an $event:Event Then the result is $result:Result which would map steps Given a condition aCondition When an anEvent Then the result is aResult to methods @Given("a condition $condition") public void aCondition(Condition condition){ } @When("an event $event") public void anEvent(Event event){ } @Then("the result is $result") public void theResultIs(Result result){ } We'd also need to decide how to integrated with existing step execution. We could output the generated steps via a bespoke reporter Format. was: At the moment, the process of writing the matching Java steps is manual, although automating their generation from the scenario textual template may be useful. It would involve defining a template of scenario steps, e.g. Given a condition $condition:Condition When an $event:Event Then the result is $result:Result which would map to methods @Given("a condition $condition") public void aCondition(Condition condition){ } @When("an event $event") public void anEvent(Event event){ } @Then("the result is $result") public void theResultIs(Result result){ } Note that the template must specify the name and type of the parameter (with a given convention, e.g. colon separated). We'd also need to come up with some "runner", that can play well both in IDE and in CLI. Something like a Template, akin to Scenario, that would match the match the template name (like scenario files match the scenario class). Fix Version/s: 3.4 Assignee: Mauro Talevi Summary: Auto-generate steps from template (was: Auto-generate steps from scenario template) > Auto-generate steps from template > --------------------------------- > > Key: JBEHAVE-148 > URL: http://jira.codehaus.org/browse/JBEHAVE-148 > Project: JBehave > Issue Type: New Feature > Components: Core > Reporter: Mauro Talevi > Assignee: Mauro Talevi > Fix For: 3.4 > > > Automated the process of writing the matching Java steps by auto-generating > stubs for steps from template. It would involve defining a template of steps > that specifies the name and type of the parameter (with a given convention, > such as colon separated). So, e.g. > Given a condition $condition:Condition > When an $event:Event > Then the result is $result:Result > which would map steps > Given a condition aCondition > When an anEvent > Then the result is aResult > to methods > @Given("a condition $condition") > public void aCondition(Condition condition){ > } > @When("an event $event") > public void anEvent(Event event){ > } > @Then("the result is $result") > public void theResultIs(Result result){ > } > We'd also need to decide how to integrated with existing step execution. We > could output the generated steps via a bespoke reporter Format. -- 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