1 package junit.extensions;
3 import junit.framework.*;
6 * A TestSuite for active Tests. It runs each
7 * test in a separate thread and waits until all
8 * threads have terminated.
9 * -- Aarhus Radisson Scandinavian Center 11th floor
11 public class ActiveTestSuite extends TestSuite {
12 private volatile int fActiveTestDeathCount;
14 public ActiveTestSuite() {
17 public ActiveTestSuite(Class theClass) {
21 public ActiveTestSuite(String name) {
25 public ActiveTestSuite(Class theClass, String name) {
26 super(theClass, name);
29 public void run(TestResult result) {
30 fActiveTestDeathCount= 0;
35 public void runTest(final Test test, final TestResult result) {
36 Thread t= new Thread() {
39 // inlined due to limitation in VA/Java
40 //ActiveTestSuite.super.runTest(test, result);
43 ActiveTestSuite.this.runFinished(test);
50 synchronized void waitUntilFinished() {
51 while (fActiveTestDeathCount < testCount()) {
54 } catch (InterruptedException e) {
60 synchronized public void runFinished(Test test) {
61 fActiveTestDeathCount++;