Reputation: 367
With Junit 4 I am seeing that there are two ways of getting fixtures setup/teardown:
I am trying to understand why two different approaches to doing the same thing. Is it related to option 1 being introduced after Java 5 annotations while TestCase
is legacy from pre Java 5? Or perhaps I am confusing the two.
Any help will be appreciated.
Upvotes: 0
Views: 365
Reputation: 3273
The two approaches , as stated in this answer is because of what is introduced in Junit3 and Junit4. It also talks about why taking annotation way is better and its advantages.
If some of your testcase are wriiten in Junit3 way and now you want to use Junit4 but wondering how this can be done , then please have a look at this. It is explained there how tests, that are written old way, can be run with Junit4
Upvotes: 1