juan_gandhi: (Default)
[personal profile] juan_gandhi
Call a method in a unittest like this:

 public void textHighLightWithPlaceholders() {...


And you will be pleasantly surprised later by the fact that junit does not run this test!

Date: 2007-03-28 12:13 am (UTC)
From: [identity profile] xryun-porosyan.livejournal.com
You can also create a method with the name setup() in your unit test.

It works especially well, if you have a big hierarchy (some sort of framework) of test classes, and you you use this method to initialize generic infrastructure in the base class of this hierarchy ...


Date: 2007-03-28 12:19 am (UTC)
From: [identity profile] xryun-porosyan.livejournal.com
Also, while building a hierarchy of test classes, you may think that it might be a good idea to invoke tearDown() from the setUp() method of your base test class ... just in case something was not cleared ... somehow.

And then, while writing a test class, extending the base class (preferably indirectly), call super.setUp() AT THE END of your setUp() method ...

Disclaimer: I didn't write it this way, I just had to debug it :)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 23rd, 2025 03:07 am
Powered by Dreamwidth Studios