dcsimg
JUnit: Testing a method alone, without object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   satya_katakam
Posted On:   Friday, February 18, 2005 09:40 AM

Hi,
I am newbee to JUnit. I am trying to test a method from a class where I need to do lot of env specific (like logger, database connection etc) initialisations in it's constructor.

I don't want to initialize all those (by creating the object, may be using 'new')for testing a small piece of code

what is the best way to acheive it?

Thanks in advance.
- Satya

Re: JUnit: Testing a method alone, without object

Posted By:   Anonymous  
Posted On:   Monday, February 21, 2005 01:00 PM

Maybe your class is trying to do too much. Perhaps the method you are trying to test belongs in a different class.
About | Sitemap | Contact