• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package junit.extensions;
2 
3 import junit.framework.*;
4 
5 /**
6  * A Decorator for Tests. Use TestDecorator as the base class
7  * for defining new test decorators. Test decorator subclasses
8  * can be introduced to add behaviour before or after a test
9  * is run.
10  *
11  */
12 public class TestDecorator extends Assert implements Test {
13 	protected Test fTest;
14 
TestDecorator(Test test)15 	public TestDecorator(Test test) {
16 		fTest= test;
17 	}
18 	/**
19 	 * The basic run behaviour.
20 	 */
basicRun(TestResult result)21 	public void basicRun(TestResult result) {
22 		fTest.run(result);
23 	}
countTestCases()24 	public int countTestCases() {
25 		return fTest.countTestCases();
26 	}
run(TestResult result)27 	public void run(TestResult result) {
28 		basicRun(result);
29 	}
30 
toString()31 	public String toString() {
32 		return fTest.toString();
33 	}
34 
getTest()35 	public Test getTest() {
36 		return fTest;
37 	}
38 }
39