mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
96c9a3529c
commit
6f6f094d30
@ -0,0 +1,26 @@
|
||||
package cn.hutool.core.thread;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
public class ExecutorBuilderTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void CallerRunsPolicyTest(){
|
||||
// https://gitee.com/dromara/hutool/pulls/660
|
||||
final ThreadPoolExecutor executor = ExecutorBuilder.create().setCorePoolSize(1).setMaxPoolSize(1).setHandler(RejectPolicy.BLOCK.getValue()).build();
|
||||
executor.execute(()-> Console.log("### 1"));
|
||||
executor.execute(()-> Console.log("### 2"));
|
||||
|
||||
executor.shutdown();
|
||||
executor.execute(()-> Console.log("### 3"));
|
||||
executor.execute(()-> Console.log("### 4"));
|
||||
executor.execute(()-> Console.log("### 5"));
|
||||
executor.execute(()-> Console.log("### 6"));
|
||||
ThreadUtil.sleep(3000);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user