use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method threadPoolMinThreadsCanBeCustomized.
@Test
void threadPoolMinThreadsCanBeCustomized() {
bind("server.jetty.threads.min=100");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMinThreads()).isEqualTo(100);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method getRequestHeaderSizes.
private List<Integer> getRequestHeaderSizes(JettyWebServer server) {
List<Integer> requestHeaderSizes = new ArrayList<>();
// Start (and directly stop) server to have connectors available
server.start();
server.stop();
Connector[] connectors = server.getServer().getConnectors();
for (Connector connector : connectors) {
connector.getConnectionFactories().stream().filter((factory) -> factory instanceof ConnectionFactory).forEach((cf) -> {
ConnectionFactory factory = (ConnectionFactory) cf;
HttpConfiguration configuration = factory.getHttpConfiguration();
requestHeaderSizes.add(configuration.getRequestHeaderSize());
});
}
return requestHeaderSizes;
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method customIdleTimeout.
@Test
void customIdleTimeout() {
bind("server.jetty.connection-idle-timeout=60s");
JettyWebServer server = customizeAndGetServer();
List<Long> timeouts = connectorsIdleTimeouts(server);
assertThat(timeouts).containsOnly(60000L);
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method accessLogCanBeEnabled.
@Test
void accessLogCanBeEnabled() {
bind("server.jetty.accesslog.enabled=true");
JettyWebServer server = customizeAndGetServer();
CustomRequestLog requestLog = getRequestLog(server);
assertThat(requestLog.getFormatString()).isEqualTo(CustomRequestLog.NCSA_FORMAT);
assertThat(requestLog.getIgnorePaths()).isNull();
RequestLogWriter logWriter = getLogWriter(requestLog);
assertThat(logWriter.getFileName()).isNull();
assertThat(logWriter.isAppend()).isFalse();
}
use of org.springframework.boot.web.embedded.jetty.JettyWebServer in project spring-boot by spring-projects.
the class JettyWebServerFactoryCustomizerTests method threadPoolMaxThreadsCanBeCustomized.
@Test
void threadPoolMaxThreadsCanBeCustomized() {
bind("server.jetty.threads.max=100");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMaxThreads()).isEqualTo(100);
}
Aggregations