aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/junit/extensions/ActiveTestSuite.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/junit/extensions/ActiveTestSuite.java')
-rw-r--r--src/main/java/junit/extensions/ActiveTestSuite.java108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/main/java/junit/extensions/ActiveTestSuite.java b/src/main/java/junit/extensions/ActiveTestSuite.java
index 0623565..95c5e2e 100644
--- a/src/main/java/junit/extensions/ActiveTestSuite.java
+++ b/src/main/java/junit/extensions/ActiveTestSuite.java
@@ -10,61 +10,61 @@ import junit.framework.TestSuite;
* test in a separate thread and waits until all
* threads have terminated.
* -- Aarhus Radisson Scandinavian Center 11th floor
- */
+ */
public class ActiveTestSuite extends TestSuite {
- private volatile int fActiveTestDeathCount;
+ private volatile int fActiveTestDeathCount;
- public ActiveTestSuite() {
- }
-
- public ActiveTestSuite(Class<? extends TestCase> theClass) {
- super(theClass);
- }
-
- public ActiveTestSuite(String name) {
- super (name);
- }
-
- public ActiveTestSuite(Class<? extends TestCase> theClass, String name) {
- super(theClass, name);
- }
-
- @Override
- public void run(TestResult result) {
- fActiveTestDeathCount= 0;
- super.run(result);
- waitUntilFinished();
- }
-
- @Override
- public void runTest(final Test test, final TestResult result) {
- Thread t= new Thread() {
- @Override
- public void run() {
- try {
- // inlined due to limitation in VA/Java
- //ActiveTestSuite.super.runTest(test, result);
- test.run(result);
- } finally {
- ActiveTestSuite.this.runFinished();
- }
- }
- };
- t.start();
- }
+ public ActiveTestSuite() {
+ }
- synchronized void waitUntilFinished() {
- while (fActiveTestDeathCount < testCount()) {
- try {
- wait();
- } catch (InterruptedException e) {
- return; // ignore
- }
- }
- }
-
- synchronized public void runFinished() {
- fActiveTestDeathCount++;
- notifyAll();
- }
+ public ActiveTestSuite(Class<? extends TestCase> theClass) {
+ super(theClass);
+ }
+
+ public ActiveTestSuite(String name) {
+ super(name);
+ }
+
+ public ActiveTestSuite(Class<? extends TestCase> theClass, String name) {
+ super(theClass, name);
+ }
+
+ @Override
+ public void run(TestResult result) {
+ fActiveTestDeathCount = 0;
+ super.run(result);
+ waitUntilFinished();
+ }
+
+ @Override
+ public void runTest(final Test test, final TestResult result) {
+ Thread t = new Thread() {
+ @Override
+ public void run() {
+ try {
+ // inlined due to limitation in VA/Java
+ //ActiveTestSuite.super.runTest(test, result);
+ test.run(result);
+ } finally {
+ ActiveTestSuite.this.runFinished();
+ }
+ }
+ };
+ t.start();
+ }
+
+ synchronized void waitUntilFinished() {
+ while (fActiveTestDeathCount < testCount()) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ return; // ignore
+ }
+ }
+ }
+
+ synchronized public void runFinished() {
+ fActiveTestDeathCount++;
+ notifyAll();
+ }
} \ No newline at end of file