Issue Type: Improvement Improvement
Affects Versions: 3.9
Assignee: Unassigned
Components: Core
Created: 04/Jun/13 9:55 PM
Description:

I did it once in a team using JBehave.

The idea is to avoid manually parsing ExamplesTable using rows Map<String, String> to match our own business data.

Instead of having a glue method like this:

@Given("some $table")
public void givenAnExamplesTable(ExamplesTable theScenarioTable)

{ ... }

We'ld have something like this:

@Given("some $table")
public void givenACustomBusinessObject(MyCustomObject myObject){ ... }

I'm going to work on this, so here's the question.
Does something like this already exists?
Otherwise, may I work directly in the core module, or i should start an external one to achieve such a thing?
I may have to modify ExamplesTableFactory, as stated in JBEHAVE-417

This can be done in several way...
Two of my favorites (i'm using fake classes/annotations for the example):

  • Annotations:

@ExamplesTable
public class MyCustomObject

{ @ExamplesColumn(mappingName="column1") private String col1; @ExamplesColumn(mappingName="column2") private Boolean col2; }
  • Manual mapping

PojoParameterConverter converter = new PojoParameterConverter<MyCustomObject>(MyCustomObject.class);

converter.addMapping("column1", "col1");
converter.addMapping("column2", "col2");

Fix Versions: 3.9
Project: JBehave
Labels: wish
Priority: Major Major
Reporter: Ghislain Nadeau
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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

Reply via email to