FileDocCategorySizeDatePackage
ActiveTestSuite.javaAPI DocAndroid 1.5 API1316Wed May 06 22:41:02 BST 2009junit.extensions

ActiveTestSuite

public class ActiveTestSuite extends TestSuite
A TestSuite for active Tests. It runs each test in a separate thread and waits until all threads have terminated. -- Aarhus Radisson Scandinavian Center 11th floor

Fields Summary
private volatile int
fActiveTestDeathCount
Constructors Summary
public ActiveTestSuite()

	
public ActiveTestSuite(Class theClass)

		super(theClass);
	
public ActiveTestSuite(String name)

		super (name);
	
public ActiveTestSuite(Class theClass, String name)

		super(theClass, name);
	
Methods Summary
public voidrun(junit.framework.TestResult result)

		fActiveTestDeathCount= 0;
		super.run(result);
		waitUntilFinished();
	
public synchronized voidrunFinished(junit.framework.Test test)

		fActiveTestDeathCount++;
		notifyAll();
	
public voidrunTest(junit.framework.Test test, junit.framework.TestResult result)

		Thread t= new Thread() {
			public void run() {
				try {
					// inlined due to limitation in VA/Java 
					//ActiveTestSuite.super.runTest(test, result);
					test.run(result);
				} finally {
					ActiveTestSuite.this.runFinished(test);
				}
			}
		};
		t.start();
	
synchronized voidwaitUntilFinished()

		while (fActiveTestDeathCount < testCount()) {
			try {
				wait();
			} catch (InterruptedException e) {
				return; // ignore
			}
		}