Skip to content

Commit

Permalink
add RejectedExecutionHandler test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bohrqiu committed Oct 3, 2024
1 parent 3467886 commit 577a0fd
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.alipay.sofa.rpc.server.UserThreadPool;
import com.alipay.sofa.rpc.server.UserVirtualThreadPool;
import com.alipay.sofa.rpc.server.SofaRejectedExecutionHandler;
import org.junit.Assert;
import org.junit.Test;
import java.util.Set;
Expand Down Expand Up @@ -67,6 +68,14 @@ public void userThreadPoolBuildTest() {
Assert.assertNull(result);
}

@Test
public void testRejectedExecutionHandler(){
UserThreadPool userThreadPool = new UserThreadPool();
Executor executorService = userThreadPool.getUserExecutor();
Assert.assertTrue(executorService instanceof ThreadPoolExecutor);
Assert.assertTrue(((ThreadPoolExecutor) executorService).getRejectedExecutionHandler() instanceof SofaRejectedExecutionHandler);
}

@Test
public void userThreadPoolCompatibleTest() {
UserThreadPool userThreadPool = new UserThreadPool();
Expand Down

0 comments on commit 577a0fd

Please sign in to comment.