1 package junit.extensions;
3 import junit.framework.*;
6 * A Decorator that runs a test repeatedly.
9 public class RepeatedTest extends TestDecorator {
10 private int fTimesRepeat;
12 public RepeatedTest(Test test, int repeat) {
15 throw new IllegalArgumentException("Repetition count must be > 0");
18 public int countTestCases() {
19 return super.countTestCases()*fTimesRepeat;
21 public void run(TestResult result) {
22 for (int i= 0; i < fTimesRepeat; i++) {
23 if (result.shouldStop())
28 public String toString() {
29 return super.toString()+"(repeated)";