mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-18 03:47:18 +01:00
63 lines
1.7 KiB
Java
63 lines
1.7 KiB
Java
package junit.extensions;
|
|
|
|
import junit.framework.Test;
|
|
import junit.framework.TestCase;
|
|
import junit.framework.TestResult;
|
|
import junit.framework.TestSuite;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes10.dex */
|
|
public class ActiveTestSuite extends TestSuite {
|
|
private volatile int fActiveTestDeathCount;
|
|
|
|
public ActiveTestSuite() {
|
|
}
|
|
|
|
@Override // junit.framework.TestSuite, junit.framework.Test
|
|
public void run(TestResult testResult) {
|
|
this.fActiveTestDeathCount = 0;
|
|
super.run(testResult);
|
|
waitUntilFinished();
|
|
}
|
|
|
|
public synchronized void runFinished() {
|
|
this.fActiveTestDeathCount++;
|
|
notifyAll();
|
|
}
|
|
|
|
@Override // junit.framework.TestSuite
|
|
public void runTest(final Test test, final TestResult testResult) {
|
|
new Thread() { // from class: junit.extensions.ActiveTestSuite.1
|
|
@Override // java.lang.Thread, java.lang.Runnable
|
|
public void run() {
|
|
try {
|
|
test.run(testResult);
|
|
} finally {
|
|
ActiveTestSuite.this.runFinished();
|
|
}
|
|
}
|
|
}.start();
|
|
}
|
|
|
|
public synchronized void waitUntilFinished() {
|
|
while (this.fActiveTestDeathCount < testCount()) {
|
|
try {
|
|
wait();
|
|
} catch (InterruptedException unused) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
public ActiveTestSuite(Class<? extends TestCase> cls) {
|
|
super(cls);
|
|
}
|
|
|
|
public ActiveTestSuite(String str) {
|
|
super(str);
|
|
}
|
|
|
|
public ActiveTestSuite(Class<? extends TestCase> cls, String str) {
|
|
super(cls, str);
|
|
}
|
|
}
|