1 package junit.extensions;
2
3 import junit.framework.Protectable;
4 import junit.framework.Test;
5 import junit.framework.TestResult;
6
7
8
9
10
11
12 public class TestSetup extends TestDecorator {
13
14 public TestSetup(Test test) {
15 super(test);
16 }
17
18 @Override
19 public void run(final TestResult result) {
20 Protectable p = new Protectable() {
21 public void protect() throws Exception {
22 setUp();
23 basicRun(result);
24 tearDown();
25 }
26 };
27 result.runProtected(this, p);
28 }
29
30
31
32
33 protected void setUp() throws Exception {
34 }
35
36
37
38
39
40 protected void tearDown() throws Exception {
41 }
42 }