dcsimg
Member variables set to null between tests?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ramanand_Hegde
Posted On:   Wednesday, February 18, 2004 12:41 AM

Hi,

I'm trying to execute a class with 2 test methods. In the first method, I'm setting the value of a member variable. In the other method, I'm using that value.

However, the 2nd test fails as though the particular member was never set (NullPointerException). Does JUnit reset member variables to null between tests?

If so, can I disable it?

Could there be any other reason why the 2nd test fails?

Regards
Ramanand

Re: Member variables set to null between tests?

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, February 18, 2004 10:16 AM

That is the whole point of "unit" tests, isn't it? otherwise you wouldn't really be testing #2 as a "unit", if everything wasn't reset first?

About | Sitemap | Contact