01: package test.tmp;
02:
03: import java.util.Random;
04:
05: import org.testng.annotations.Test;
06:
07: public class Tmp {
08:
09: @Test(invocationCount=10,threadPoolSize=5)
10: public void f() {
11: ppp("START " + Thread.currentThread().getId());
12: try {
13: Thread.sleep(Math.abs(new Random().nextInt() % 300));
14: } catch (InterruptedException e) {
15: e.printStackTrace();
16: }
17: ppp("END " + Thread.currentThread().getId());
18: }
19:
20: private void ppp(String string) {
21: System.out.println("[Tmp] " + string);
22: }
23:
24: }
|