[阅读: 364] 2006-08-22 10:13:31
package bjepb.unittest;
import bjepb.promng.Management;
public class TestRunner {
public static void main(String[] args) {
ThreadGroup threadgroup = new ThreadGroup("GroupChild");
for (int i=0; i<10; i++)
{
Thread thread = new Thread(threadgroup,new TestEmployee());
thread.setName("wy-".concat(Integer.toString(i+1)));
thread.start();
}
while (threadgroup.activeCount() != 1)
{
//System.out.println("activeCount " + Integer.toString(threadgroup.activeCount()));
try{
Thread.sleep(2000);
}
catch (Exception e){
e.printStackTrace();
}
}
Management.getManagement().PrintEmployees();
}
}