• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package junit.extensions;
2 
3 import junit.framework.Assert;
4 import junit.framework.Test;
5 import junit.framework.TestResult;
6 
7 /**
8  * A Decorator for Tests. Use TestDecorator as the base class for defining new
9  * test decorators. Test decorator subclasses can be introduced to add behaviour
10  * before or after a test is run.
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     /**
20      * The basic run behaviour.
21      */
basicRun(TestResult result)22     public void basicRun(TestResult result) {
23         fTest.run(result);
24     }
25 
countTestCases()26     public int countTestCases() {
27         return fTest.countTestCases();
28     }
29 
run(TestResult result)30     public void run(TestResult result) {
31         basicRun(result);
32     }
33 
34     @Override
toString()35     public String toString() {
36         return fTest.toString();
37     }
38 
getTest()39     public Test getTest() {
40         return fTest;
41     }
42 }