With Junit 4 I am seeing that there are two ways of getting fixtures setup/teardown:
- Decorate setup/tearDown methods with @Before and @After respectively
- Extend TestCase and override 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.