[
http://jira.codehaus.org/browse/JBEHAVE-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mauro Talevi updated JBEHAVE-148:
---------------------------------
Description:
Auto-generate method stubs with no parameters. The steps such as
Given there is a flight
And there is a customer
When the customer books the flight
Then the customer is shown on the manifest
would generate Java methods like this:
@Given("there is a flight")
@Pending
public void givenThereIsAFlight() {
}
@Given("there is a customer") // note 'Given', even though story line is 'And'
@Pending
public void givenThereIsACustomer() {
}
@When("the customer books the flight")
@Pending
public void whenTheCustomerBooksTheFlight() {
}
@Then("the customer is shown on the flight manifest")
@Pending
public void thenTheCustomerIsShownOnTheFlightManifest() {
}
If @Pending annotated methods are already matched the methods should not be
re-generated.
was:
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.
Issue Type: Improvement (was: New Feature)
Summary: Auto-generate method stubs for pending steps with no
parameters (was: Auto-generate method stubs for pending steps)
> Auto-generate method stubs for pending steps with no parameters
> ---------------------------------------------------------------
>
> Key: JBEHAVE-148
> URL: http://jira.codehaus.org/browse/JBEHAVE-148
> Project: JBehave
> Issue Type: Improvement
> Components: Core
> Reporter: Mauro Talevi
> Assignee: Mauro Talevi
> Fix For: 3.4
>
>
> Auto-generate method stubs with no parameters. The steps such as
> Given there is a flight
> And there is a customer
> When the customer books the flight
> Then the customer is shown on the manifest
> would generate Java methods like this:
> @Given("there is a flight")
> @Pending
> public void givenThereIsAFlight() {
> }
> @Given("there is a customer") // note 'Given', even though story line is 'And'
> @Pending
> public void givenThereIsACustomer() {
> }
> @When("the customer books the flight")
> @Pending
> public void whenTheCustomerBooksTheFlight() {
> }
> @Then("the customer is shown on the flight manifest")
> @Pending
> public void thenTheCustomerIsShownOnTheFlightManifest() {
> }
> If @Pending annotated methods are already matched the methods should not be
> re-generated.
--
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