![]() |
|
|
Change By:
|
Mauro Talevi
(16/Jun/13 12:52 PM)
|
Description:
|
I did it once in a team using JBehave.
The idea is to
avoid manually parsing
map the
ExamplesTable
using
rows
*Map<String, String>*
to match
our own
a
business
data
object
.
Instead
So, instead
of having a
glue
method like this:
@Given("some $table") public void givenAnExamplesTable(ExamplesTable
theScenarioTable
table
){ ... }
We'
ld
d
have something like this:
@Given("some $table") public void givenACustomBusinessObject(MyCustomObject myObject){ ... }
Or a List of business objects:
@Given("some $table")
I'm going to work on this, so here's the question
public void givenACustomBusinessObject(List<MyCustomObject> myObjectList){
.
.. }
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)
two ways
:
*
Annotations
Annotation-based mapping
:
@
ExamplesTable
AsParameters
public class MyCustomObject{ @
ExamplesColumn
Parameter
(
mappingName
name
="column1") private String col1;
@
ExamplesColumn
Parameter
(
mappingName
name
="column2") private Boolean col2; }
*
Manual
Named-based
mapping
PojoParameterConverter converter = new PojoParameterConverter<MyCustomObject>(MyCustomObject.class);
converter.addMapping("column1"
,
"col1"); converter
using the name of the field as the parameter name
.
addMapping("column2", "col2");
|
Affects Version/s:
|
3.9
|
Assignee:
|
Mauro Talevi
|
Summary:
|
Parse
Allow mapping of
ExamplesTable
directly into Pojos
rows to annotated custom types
|
|
|
|
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