[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Mauro Talevi resolved JBEHAVE-922 as Fixed Allow mapping of ExamplesTable rows to annotated custom types Change By: Mauro Talevi (23/Jun/13 1:00 PM) Resolution: Fixed Status: Open Resolved 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
[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Mauro Talevi commented on JBEHAVE-922 Allow mapping of ExamplesTable rows to annotated custom types Right, this usecase could indeed be useful. I've added the ability to specify an optional map with the field name mapping. Check latest snapshot. Thanks for your insight and suggestions! 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
[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Ghislain Nadeau commented on JBEHAVE-922 Allow mapping of ExamplesTable rows to annotated custom types Nice! Thanks for the development. I guess you can close the issue. 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
[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Ghislain Nadeau commented on JBEHAVE-922 Allow mapping of ExamplesTable rows to annotated custom types Hi Mauro, this is actually pretty nice and easy to use! I still think it could be of some use to be able to map a third party object by defining a mapping between the third-party fields against the column names. Something like: ThirdPartyClass.java public class ThirdPartyClass{ private Integer aInteger; } ThirdPartyClass.java ParameterMapping map = new ParameterMapping(); map.addMapping("scenarioColumn1", "aInteger"); examplesTable.getRowsAs(ThirdPartyClass.class, map); 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
[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Ghislain Nadeau edited a comment on JBEHAVE-922 Allow mapping of ExamplesTable rows to annotated custom types Hi Mauro, this is actually pretty nice and easy to use! I still think it could be of some use to be able to map a third party object by defining a mapping between the third-party fields against the column names. Something like: ThirdPartyClass.java public class ThirdPartyClass{ private Integer aInteger; } ThirdPartyClass.java ParameterMapping map = new ParameterMapping(); map.addMapping("scenarioColumn1", "aInteger"); examplesTable.getRowsAs(ThirdPartyClass.class, map); Btw, thanks for reformulating my messages, you might have noticed english is not my native language. 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
[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Mauro Talevi commented on JBEHAVE-922 Allow mapping of ExamplesTable rows to annotated custom types What's the advantage of doing this over the annotations? public class ThirdPartyClass{ @Parameter(name = "scenarioColumn1") private Integer aInteger; } If you're accessing the ExampleTable directly then you can use the Parameters interface Parameters parameters = examplesTable.getRowsAsParameters().get(0); parameters.valueAs("scenarioColumn1", Integer.class); 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
[jbehave-dev] [jira] (JBEHAVE-922) Allow mapping of ExamplesTable rows to annotated custom types
Mauro Talevi updated JBEHAVE-922 Allow mapping of ExamplesTable rows to annotated custom types Change By: Mauro Talevi (16/Jun/13 12:52 PM) Description: IdiditonceinateamusingJBehave. Theideaisto avoidmanuallyparsing mapthe ExamplesTable using rows *MapString,String* tomatch ourown a business data object . Instead So,instead ofhavinga glue methodlikethis:@Given(some$table)publicvoidgivenAnExamplesTable(ExamplesTable theScenarioTable table ){...}We ld d havesomethinglikethis:@Given(some$table)publicvoidgivenACustomBusinessObject(MyCustomObjectmyObject){...} OraListofbusinessobjects: @Given(some$table) Imgoingtoworkonthis,soheresthequestion publicvoidgivenACustomBusinessObject(ListMyCustomObjectmyObjectList){ . ..} Doessomethinglikethisalreadyexists? Otherwise,mayIworkdirectlyinthecoremodule,orishouldstartanexternalonetoachievesuchathing?ImayhavetomodifyExamplesTableFactory,asstatedinJBEHAVE-417 Thiscanbedonein severalway...Twoofmyfavorites(imusingfakeclasses/annotationsfortheexample) twoways :* Annotations Annotation-basedmapping :@ ExamplesTable AsParameters publicclassMyCustomObject{@ ExamplesColumn Parameter ( mappingName name =column1)privateStringcol1;@ ExamplesColumn Parameter ( mappingName name =column2)privateBooleancol2;}* Manual Named-based mapping PojoParameterConverterconverter=newPojoParameterConverterMyCustomObject(MyCustomObject.class);converter.addMapping(column1 , col1);converter usingthenameofthefieldastheparametername . addMapping(column2,col2); Affects Version/s: 3.9 Assignee: MauroTalevi Summary: Parse Allowmappingof ExamplesTable directlyintoPojos rowstoannotatedcustomtypes 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