Returning a custom object from
1 posts in topic
Flat View  Flat View

Posted By:   Mark_Borg
Posted On:   Friday, June 13, 2008 07:14 AM

Hi Guys

I am in a situation where i need to return a custom object
from a rather thanthe normal TestResult. The test will be returning our custom object and we need to interpret that object.

Could you kindly guide me in achieving this.

Re: Returning a custom object from

Posted By:   Robert_Lybarger  
Posted On:   Friday, June 13, 2008 06:21 PM

You could either look into sub-classing TestRunner and provide a new run method, or look into subclassing and extending the TestResult object, possibly to include a member instance of your custom class inside it with a getter/setter method pair. Or something along that line. Or being a source forge project, you could pull the source and actually *change* TestRunner's behavior to do anything you want. (Not being a day-to-day user of junit, I have no idea which of those options are good, or whether there's anything better provided in the api itself. Just random ideas.)
About | Sitemap | Contact