TestNG 多线程测试

时间:2024-01-04 16:28:32

TestNG以注解的方式实现多线程测试

import org.testng.annotations.Test;

public class TreadDemo {

    // invocationCount 方法执行的次数据
// threadPoolSize 线程数
@Test(invocationCount = 10,threadPoolSize = 3)
public void testThreadPools(){
System.out.println("线程ID:"+Thread.currentThread().getId()+" Hello");
}
}

TestNG 多线程测试