use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method threadPoolWithMaxQueueCapacityPositiveCreateBlockingArrayQueue.
@Test
void threadPoolWithMaxQueueCapacityPositiveCreateBlockingArrayQueue() {
bind("server.jetty.threads.max-queue-capacity=1234");
JettyWebServer server = customizeAndGetServer();
ThreadPool threadPool = server.getServer().getThreadPool();
BlockingQueue<?> queue = getQueue(threadPool);
assertThat(queue).isInstanceOf(BlockingArrayQueue.class);
assertThat(((BlockingArrayQueue<?>) queue).getMaxCapacity()).isEqualTo(1234);
assertDefaultThreadPoolSettings(threadPool);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class ServerPropertiesTests method jettyThreadPoolPropertyDefaultsShouldMatchServerDefault.
@Test
void jettyThreadPoolPropertyDefaultsShouldMatchServerDefault() {
JettyServletWebServerFactory jettyFactory = new JettyServletWebServerFactory(0);
JettyWebServer jetty = (JettyWebServer) jettyFactory.getWebServer();
Server server = jetty.getServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getThreadPool();
int idleTimeout = threadPool.getIdleTimeout();
int maxThreads = threadPool.getMaxThreads();
int minThreads = threadPool.getMinThreads();
assertThat(this.properties.getJetty().getThreads().getIdleTimeout().toMillis()).isEqualTo(idleTimeout);
assertThat(this.properties.getJetty().getThreads().getMax()).isEqualTo(maxThreads);
assertThat(this.properties.getJetty().getThreads().getMin()).isEqualTo(minThreads);
}
Aggregations