ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/junit/extensions/ActiveTestSuite.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/junit/extensions/ActiveTestSuite.java
Status
scanned
Type
file
Name
ActiveTestSuite.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
1783 (1.7 KB)
MD5
7eec50a66f6050fbb200f75c0efdd13a
SHA1
a64e57f7c71273c24a2d3bab43dfc327d630e5ab
SHA256
f3ba528c2352b2075a554659cfb4e905158b13d858c11f88fbde13627bf36b22
SHA512

      
    
SHA1_git
6f0f99dad04e0fd216b77ca7c7d7568abf3d609c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ActiveTestSuite.java | 1.7 KB |

package junit.extensions; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.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 */ public class ActiveTestSuite extends TestSuite { 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(); } synchronized void waitUntilFinished() { while (fActiveTestDeathCount < testCount()) { try { wait(); } catch (InterruptedException e) { return; // ignore } } } public synchronized void runFinished() { fActiveTestDeathCount++; notifyAll(); } }