Skip to main content

Blog Archive for simongbrown during April 2004

Like many people, I want a way to run some one-time set up and tear down logic and the approach I usually take is to drop some code into a static initializer block in an abstract test case. For example... public abstract class SomeTestCase extends TestCase {  static {    // perform the "global" set up logic  }} Providing that I remember to subclass...