Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355409

Summary: JUnit: Use @Before and @After framework instead of relying on super calls from subclasses in setUp()/tearDown() for lifecycle
Product: z_Archived Reporter: Michael OBrien <michael.f.obrien>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
JUnit framework change to use @Before @After example none

Description Michael OBrien CLA 2011-08-22 11:49:59 EDT
>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.
Comment 1 Michael OBrien CLA 2011-08-22 11:51:50 EDT
Created attachment 201934 [details]
JUnit framework change to use @Before @After example
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:17:11 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:23:34 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink