assertEquals(60, tp.getKeepAliveTime(TimeUnit.SECONDS));
assertIsInstanceOf(ThreadPoolExecutor.CallerRunsPolicy.class, tp.getRejectedExecutionHandler());
}
public void testGetThreadPoolProfileInheritCustomDefaultValues() throws Exception {
ThreadPoolProfile newDefault = new ThreadPoolProfile("newDefault");
newDefault.setKeepAliveTime(30L);
newDefault.setMaxPoolSize(50);
newDefault.setPoolSize(5);
newDefault.setMaxQueueSize(2000);
newDefault.setRejectedPolicy(ThreadPoolRejectedPolicy.Abort);
context.getExecutorServiceManager().setDefaultThreadPoolProfile(newDefault);
assertNull(context.getExecutorServiceManager().getThreadPoolProfile("foo"));
ThreadPoolProfile foo = new ThreadPoolProfile("foo");
foo.setMaxPoolSize(25);
foo.setPoolSize(1);
context.getExecutorServiceManager().registerThreadPoolProfile(foo);
assertSame(foo, context.getExecutorServiceManager().getThreadPoolProfile("foo"));
ExecutorService executor = context.getExecutorServiceManager().newThreadPool(this, "MyPool", "foo");