public class InvocationCnt { @Test(invocationCount=5) public void test1() throws InterruptedException { System.out.println("Thread ID: "+Thread.currentThread().getId()); } }
OutPut:
Thread ID: 1
Thread ID: 1
Thread ID: 1
Thread ID: 1
Thread ID: 1
above method ran 5 times, a single thread will be assigned to run the method one by one..
Now let's see with threadPoolSize implementation