mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix tester bug
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package cn.hutool.core.thread;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ConcurrencyTesterTest {
|
||||
|
||||
@@ -18,4 +18,19 @@ public class ConcurrencyTesterTest {
|
||||
});
|
||||
Console.log(tester.getInterval());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void multiTest(){
|
||||
ConcurrencyTester ct = new ConcurrencyTester(5);
|
||||
for(int i=0;i<3;i++){
|
||||
Console.log("开始执行第{}个",i);
|
||||
ct.test(() -> {
|
||||
// 需要并发测试的业务代码
|
||||
Console.log("当前执行线程:" + Thread.currentThread().getName()+" 产生时间 "+ DateUtil.now());
|
||||
ThreadUtil.sleep(RandomUtil.randomInt(1000, 3000));
|
||||
});
|
||||
}
|
||||
Console.log("全部线程执行完毕 "+DateUtil.now());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user