JUnit 3 test runners invoke the setUp()
method before running each test.
For example, from XOM:
protected void setUp() {
System.setErr(new PrintStream(new ByteArrayOutputStream()));
inputDir = new File("data");
inputDir = new File(inputDir, "xslt");
inputDir = new File(inputDir, "input");
}
Each setUp()
method is supposed to invoke its superclass's setUp()
method, but this is often forgotten