|
|
@ -259,26 +259,23 @@ public class JettyEmbeddedServletContainerFactoryTests
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void threadPool() throws Exception {
|
|
|
|
public void defaultThreadPool() throws Exception {
|
|
|
|
JettyEmbeddedServletContainerFactory factory = getFactory();
|
|
|
|
JettyEmbeddedServletContainerFactory factory = getFactory();
|
|
|
|
|
|
|
|
factory.setThreadPool(null);
|
|
|
|
ThreadPool threadPool = mock(ThreadPool.class);
|
|
|
|
assertThat(factory.getThreadPool()).isNull();
|
|
|
|
factory.setThreadPool(threadPool);
|
|
|
|
JettyEmbeddedServletContainer servletContainer = (JettyEmbeddedServletContainer) factory
|
|
|
|
|
|
|
|
.getEmbeddedServletContainer();
|
|
|
|
JettyEmbeddedServletContainer servletContainer = (JettyEmbeddedServletContainer) factory.getEmbeddedServletContainer();
|
|
|
|
assertThat(servletContainer.getServer().getThreadPool()).isNotNull();
|
|
|
|
assertThat(servletContainer.getServer().getThreadPool()).isSameAs(threadPool);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void nullThreadPool() throws Exception {
|
|
|
|
public void customThreadPool() throws Exception {
|
|
|
|
JettyEmbeddedServletContainerFactory factory = getFactory();
|
|
|
|
JettyEmbeddedServletContainerFactory factory = getFactory();
|
|
|
|
|
|
|
|
ThreadPool threadPool = mock(ThreadPool.class);
|
|
|
|
factory.setThreadPool(null);
|
|
|
|
factory.setThreadPool(threadPool);
|
|
|
|
|
|
|
|
JettyEmbeddedServletContainer servletContainer = (JettyEmbeddedServletContainer) factory
|
|
|
|
assertThat(factory.getThreadPool()).isNull();
|
|
|
|
.getEmbeddedServletContainer();
|
|
|
|
|
|
|
|
assertThat(servletContainer.getServer().getThreadPool()).isSameAs(threadPool);
|
|
|
|
JettyEmbeddedServletContainer servletContainer = (JettyEmbeddedServletContainer) factory.getEmbeddedServletContainer();
|
|
|
|
|
|
|
|
assertThat(servletContainer.getServer().getThreadPool()).isNotNull();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|