Ethon

为什么要有方法,因为懒惰是一种美德。

   :: 首页  :: 新随笔  ::  ::  :: 管理

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

 

posted on 2019-09-27 12:09  Ethon  阅读(411)  评论(0编辑  收藏  举报