Community
Participate
Working Groups
>Issue: We currently rely on subclasses to properly call super.setUp() first and super.tearDown() last in their own code. The superclass methods are empty, but in the future if general setup and teardown functionality is added we may leak test configuration between subsequently running suites. >Fix: Use @Before and @After to manage setup/teardown lifecycle. The superclass @Before and @After will encompas any subclass @Before and @After as expected - without the use of super calls. Make the superclass setup/tearDown final and rename them so that the framework general lifecycle events will always get run. Do not defer to an abstract setup/teardown implemented by subclass - the JUnit framework will do this for us via proper use of annotations.
Created attachment 201934 [details] JUnit framework change to use @Before @After example
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink