From: Adam S. <ada...@ja...> - 2006-01-25 12:40:06
|
Hi Markus! >When is the release of the additional documentions? No date set yet - rather, I think the documentation will appear on our web when parts of it is done, and will be upgraded during this spring. Currently, we're deep in refactoring, but when things quiet down, we'll be able to describe how it works. Hope you're not too disappointed. Keep asking questions on the list, and we'll try to answer them for you. Also, have a look at http://confluence.ddsteps.org/display/www/Data+Driven and see if that answers any questions. >I want to Marshall an POJO wiht Testdata from Excel and verify the input >in the DB so i thought DDSteps would be a good choice! I think so too :-) >So how works the properties injection with objects for example : > >PartnerInterest p = new PartnerInterest(); >Interest i = new Interest(); >i.setInterest("any"); If you do data injection "directly" from excel, you do like this: 1) In your setUpBeforeData() - a DDSteps special callback - you create the beans that you want injected with data. DDSteps cannot build an object graph for you. Then "expose" that bean like this. I'll do an example with a partner. (In your TestCase) private Partner partner; public Partner getParter() {retrun partner}; protected void setUpBeforeData() { partner = new Parter(); partner.getInterests().add(new PartnerInterest()); // 0 partner.getInterests().add(new PartnerInterest()); // 1 } (In your excel file) A | B partner.interests[0].interest | partner.interests[1].interest Any | Other Interest And so on... >How can i work with this considering the excel files! >If its not possible what would be the workaround. How can i customize >that or must be everything illustratable in Excel? If you have much more elaborate data strcutures, you may actually wan to read in and unmarshall an XML document instead. We're thinking of adding a good xstream support (you're welcome to help) to do this. But so far, you would then use DDSteps to just run the test many times: (In your testcase) private InputStream xmlFile; public void setXmlFile(InputStream file) {...} public void testSomething() { MyObjectGrapt obj = xstream.fromXml(xmlFile, obj); ... } (In Excel) xmlFile | someOtherTestProperty path/to/file1.xml | ... path/to/file2.xml | ... So it now runs through all you XML files - you probably have many different combinations of test data apart from the beans loaded from XML. Hope this helps! Regards /Adam Skogman, DDSteps project lead |