Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5583f64b
Commit
5583f64b
authored
May 06, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to verify Jetty's thread pool defaults match server defaults
Closes gh-21213
parent
f29bce65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+17
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
5583f64b
...
...
@@ -40,6 +40,8 @@ import org.apache.catalina.valves.RemoteIpValve;
import
org.apache.coyote.AbstractProtocol
;
import
org.eclipse.jetty.server.HttpChannel
;
import
org.eclipse.jetty.server.Request
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.util.thread.ThreadPool
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.autoconfigure.web.ServerProperties.Tomcat.Accesslog
;
...
...
@@ -55,6 +57,7 @@ import org.springframework.http.HttpEntity;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.client.ClientHttpResponse
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.unit.DataSize
;
...
...
@@ -354,6 +357,20 @@ class ServerPropertiesTests {
assertThat
(
this
.
properties
.
getTomcat
().
getUseRelativeRedirects
()).
isFalse
();
}
@Test
void
jettyThreadPoolPropertyDefaultsShouldMatchServerDefault
()
{
JettyServletWebServerFactory
jettyFactory
=
new
JettyServletWebServerFactory
(
0
);
JettyWebServer
jetty
=
(
JettyWebServer
)
jettyFactory
.
getWebServer
();
Server
server
=
(
Server
)
ReflectionTestUtils
.
getField
(
jetty
,
"server"
);
ThreadPool
threadPool
=
(
ThreadPool
)
ReflectionTestUtils
.
getField
(
server
,
"_threadPool"
);
int
idleTimeout
=
(
int
)
ReflectionTestUtils
.
getField
(
threadPool
,
"_idleTimeout"
);
int
maxThreads
=
(
int
)
ReflectionTestUtils
.
getField
(
threadPool
,
"_maxThreads"
);
int
minThreads
=
(
int
)
ReflectionTestUtils
.
getField
(
threadPool
,
"_minThreads"
);
assertThat
(
this
.
properties
.
getJetty
().
getThreadIdleTimeout
().
toMillis
()).
isEqualTo
(
idleTimeout
);
assertThat
(
this
.
properties
.
getJetty
().
getMaxThreads
()).
isEqualTo
(
maxThreads
);
assertThat
(
this
.
properties
.
getJetty
().
getMinThreads
()).
isEqualTo
(
minThreads
);
}
@Test
void
jettyMaxHttpFormPostSizeMatchesDefault
()
throws
Exception
{
JettyServletWebServerFactory
jettyFactory
=
new
JettyServletWebServerFactory
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment