From: Adam S. <ada...@ja...> - 2006-02-26 16:34:23
|
Sebastian Simon wrote: > For example i have a Test with a property > > private int[] myIntArray; > > and i want to test the contents of the array within the testmethod. Hi Sebastian! I've looked at the problem again, and I've found a solution! You do have to write your own property editor. Just look at the StringArrayPropertyEditor in Spring and copy-paste or hack it yourself - it should be pretty easy. I suggest just cutting up the int using comma or space. Then you have to register that property editor with the JavaBean Manager: java.beans.PropertyEditorManager#registerEditor(int[].class, oneSebastiansIntArrayEditor); You could do that in setUpMethod() in your test case. Just call the same method with null to unregister. If you are willing to donate the code for your int array editor, I'll be happy to include it in the next version of DDSteps. Just file an enhancement request at: jira.ddsteps.org or send me an email! Regards /Adam Skogman -- Adam Skogman, J2EE Consultant Jayway AB Mobile: +46 701 46 92 91 Office: +46 40 12 72 83 Web: www.jayway.se |