TestNG 多线程测试

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");
    }
}

原文地址:https://www.cnblogs.com/wakey/p/11597089.html