1package junit.tests.extensions;2import junit.extensions.ActiveTestSuite;3import junit.extensions.RepeatedTest;4import junit.framework.Test;5import junit.framework.TestCase;6import junit.framework.TestResult;7/**8 * Testing the ActiveTest support9 */10public class ActiveTestTest extends TestCase {11 public static class SuccessTest extends TestCase {12 @Override13 public void runTest() {14 }15 }16 public void testActiveTest() {17 Test test = createActiveTestSuite();18 TestResult result = new TestResult();19 test.run(result);20 assertEquals(100, result.runCount());21 assertEquals(0, result.failureCount());22 assertEquals(0, result.errorCount());23 }24 public void testActiveRepeatedTest() {25 Test test = new RepeatedTest(createActiveTestSuite(), 5);26 TestResult result = new TestResult();27 test.run(result);28 assertEquals(500, result.runCount());29 assertEquals(0, result.failureCount());30 assertEquals(0, result.errorCount());31 }32 public void testActiveRepeatedTest0() {33 Test test = new RepeatedTest(createActiveTestSuite(), 0);34 TestResult result = new TestResult();35 test.run(result);36 assertEquals(0, result.runCount());37 assertEquals(0, result.failureCount());38 assertEquals(0, result.errorCount());39 }40 public void testActiveRepeatedTest1() {41 Test test = new RepeatedTest(createActiveTestSuite(), 1);42 TestResult result = new TestResult();43 test.run(result);44 assertEquals(100, result.runCount());45 assertEquals(0, result.failureCount());46 assertEquals(0, result.errorCount());47 }48 ActiveTestSuite createActiveTestSuite() {49 ActiveTestSuite suite = new ActiveTestSuite();50 for (int i = 0; i < 100; i++) {51 suite.addTest(new SuccessTest());52 }53 return suite;54 }55}...