Files
yacy_search_server/test/java/net/yacy/http/HttpServerBootstrapConfigTest.java
Michael Peter Christen 554911a88f Migration to Jetty 12.1.11
2026-07-12 12:03:57 +02:00

26 lines
1.1 KiB
Java

package net.yacy.http;
import org.junit.Assert;
import org.junit.Test;
public class HttpServerBootstrapConfigTest {
@Test
public void testAcceptorCountIsClamped() {
Assert.assertEquals(1, HttpServerBootstrapConfig.acceptorCountFor(1));
Assert.assertEquals(1, HttpServerBootstrapConfig.acceptorCountFor(2));
Assert.assertEquals(2, HttpServerBootstrapConfig.acceptorCountFor(4));
Assert.assertEquals(4, HttpServerBootstrapConfig.acceptorCountFor(8));
Assert.assertEquals(4, HttpServerBootstrapConfig.acceptorCountFor(64));
}
@Test
public void testFixedConnectorLimits() {
Assert.assertEquals(16_384, HttpServerBootstrapConfig.REQUEST_HEADER_SIZE);
Assert.assertEquals(9_000L, HttpServerBootstrapConfig.CONNECTOR_IDLE_TIMEOUT_MILLIS);
Assert.assertEquals(128, HttpServerBootstrapConfig.ACCEPT_QUEUE_SIZE);
Assert.assertEquals(4_096, HttpServerBootstrapConfig.REQUEST_INFLATE_BUFFER_SIZE);
Assert.assertEquals(200_000, HttpServerBootstrapConfig.MAX_FORM_CONTENT_SIZE);
}
}