Browse Source

Create spring-boot-web-server module

See gh-46145
pull/46230/head
Andy Wilkinson 8 months ago
parent
commit
a793efe486
  1. 1
      settings.gradle
  2. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle
  3. 1
      spring-boot-project/spring-boot-all/build.gradle
  4. 2
      spring-boot-project/spring-boot-autoconfigure-all/build.gradle
  5. 6
      spring-boot-project/spring-boot-autoconfigure/build.gradle
  6. 3
      spring-boot-project/spring-boot-dependencies/build.gradle
  7. 4
      spring-boot-project/spring-boot-jetty/build.gradle
  8. 4
      spring-boot-project/spring-boot-reactor-netty/build.gradle
  9. 2
      spring-boot-project/spring-boot-session-data-mongodb/build.gradle
  10. 2
      spring-boot-project/spring-boot-session-data-redis/build.gradle
  11. 2
      spring-boot-project/spring-boot-session/build.gradle
  12. 1
      spring-boot-project/spring-boot-test/build.gradle
  13. 9
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java
  14. 4
      spring-boot-project/spring-boot-tomcat/build.gradle
  15. 2
      spring-boot-project/spring-boot-tx/src/test/java/org/springframework/boot/transaction/autoconfigure/TransactionManagerCustomizationAutoConfigurationTests.java
  16. 4
      spring-boot-project/spring-boot-undertow/build.gradle
  17. 53
      spring-boot-project/spring-boot-web-server/build.gradle
  18. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java
  19. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Compression.java
  20. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java
  21. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Cookie.java
  22. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java
  23. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java
  24. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Http2.java
  25. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/MimeMappings.java
  26. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseException.java
  27. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java
  28. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Shutdown.java
  29. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Ssl.java
  30. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServer.java
  31. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerException.java
  32. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactory.java
  33. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java
  34. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java
  35. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java
  36. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java
  37. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java
  38. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java
  39. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java
  40. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java
  41. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java
  42. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java
  43. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java
  44. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/package-info.java
  45. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/package-info.java
  46. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java
  47. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java
  48. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java
  49. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java
  50. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java
  51. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java
  52. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java
  53. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java
  54. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java
  55. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java
  56. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java
  57. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/package-info.java
  58. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java
  59. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java
  60. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java
  61. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java
  62. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java
  63. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java
  64. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java
  65. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java
  66. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Session.java
  67. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java
  68. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java
  69. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java
  70. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java
  71. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java
  72. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java
  73. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java
  74. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java
  75. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java
  76. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java
  77. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java
  78. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java
  79. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java
  80. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java
  81. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java
  82. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java
  83. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java
  84. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java
  85. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java
  86. 0
      spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/package-info.java
  87. 13
      spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring.factories
  88. 2
      spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring/aot.factories
  89. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/CompressionTests.java
  90. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java
  91. 188
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/SpringApplicationWebServerTests.java
  92. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java
  93. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java
  94. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java
  95. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java
  96. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java
  97. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java
  98. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java
  99. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java
  100. 0
      spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java
  101. Some files were not shown because too many files have changed in this diff Show More

1
settings.gradle

@ -158,6 +158,7 @@ include "spring-boot-project:spring-boot-tools:spring-boot-test-support-docker" @@ -158,6 +158,7 @@ include "spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"
include "spring-boot-project:spring-boot-tx"
include "spring-boot-project:spring-boot-undertow"
include "spring-boot-project:spring-boot-validation"
include "spring-boot-project:spring-boot-web-server"
include "spring-boot-project:spring-boot-webflux"
include "spring-boot-project:spring-boot-webmvc"
include "spring-boot-project:spring-boot-webservices"

2
spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

@ -185,7 +185,7 @@ dependencies { @@ -185,7 +185,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-hateoas"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation("io.micrometer:micrometer-observation-test")
testImplementation("io.opentelemetry:opentelemetry-exporter-common")
testImplementation("io.projectreactor:reactor-test")

1
spring-boot-project/spring-boot-all/build.gradle

@ -91,7 +91,6 @@ dependencies { @@ -91,7 +91,6 @@ dependencies {
}
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation("com.ibm.db2:jcc")
testImplementation("com.sun.xml.messaging.saaj:saaj-impl")
testImplementation("io.projectreactor:reactor-test")

2
spring-boot-project/spring-boot-autoconfigure-all/build.gradle

@ -175,7 +175,7 @@ dependencies { @@ -175,7 +175,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
testImplementation(project(":spring-boot-project:spring-boot-mustache"))
testImplementation(project(":spring-boot-project:spring-boot-thymeleaf"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("ch.qos.logback:logback-classic")
testImplementation("commons-fileupload:commons-fileupload")

6
spring-boot-project/spring-boot-autoconfigure/build.gradle

@ -27,6 +27,7 @@ description = "Spring Boot AutoConfigure" @@ -27,6 +27,7 @@ description = "Spring Boot AutoConfigure"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-web-server"))
optional("com.github.ben-manes.caffeine:caffeine")
optional("org.aspectj:aspectjweaver")
@ -34,8 +35,6 @@ dependencies { @@ -34,8 +35,6 @@ dependencies {
optional("jakarta.servlet:jakarta.servlet-api")
optional("javax.money:money-api")
optional("org.springframework:spring-web")
optional("org.springframework:spring-web")
optional("org.springframework:spring-web")
optional("org.springframework.data:spring-data-commons")
testFixturesCompileOnly(project(":spring-boot-project:spring-boot-test"))
@ -43,11 +42,14 @@ dependencies { @@ -43,11 +42,14 @@ dependencies {
testFixturesCompileOnly("javax.cache:cache-api")
testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-api")
testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-client-api")
testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation("ch.qos.logback:logback-classic")
testImplementation("com.fasterxml.jackson.core:jackson-databind")
testImplementation("io.projectreactor:reactor-core")

3
spring-boot-project/spring-boot-dependencies/build.gradle

@ -2127,7 +2127,8 @@ bom { @@ -2127,7 +2127,8 @@ bom {
"spring-boot-webflux",
"spring-boot-webmvc",
"spring-boot-webservices",
"spring-boot-websocket"
"spring-boot-websocket",
"spring-boot-web-server"
]
plugins = [
"spring-boot-maven-plugin"

4
spring-boot-project/spring-boot-jetty/build.gradle

@ -26,7 +26,7 @@ plugins { @@ -26,7 +26,7 @@ plugins {
description = "Spring Boot Jetty"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-web-server"))
api("org.eclipse.jetty.ee10:jetty-ee10-servlets")
api("org.eclipse.jetty.ee10:jetty-ee10-webapp")
@ -40,7 +40,7 @@ dependencies { @@ -40,7 +40,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("org.apache.httpcomponents.client5:httpclient5")

4
spring-boot-project/spring-boot-reactor-netty/build.gradle

@ -26,7 +26,7 @@ plugins { @@ -26,7 +26,7 @@ plugins {
description = "Spring Boot Reactor Netty"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-web-server"))
api("io.projectreactor.netty:reactor-netty-http")
api("org.springframework:spring-web")
@ -37,7 +37,7 @@ dependencies { @@ -37,7 +37,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.springframework:spring-webflux")

2
spring-boot-project/spring-boot-session-data-mongodb/build.gradle

@ -38,7 +38,9 @@ dependencies { @@ -38,7 +38,9 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-webflux"))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-session")))
dockerTestImplementation("org.mongodb:mongodb-driver-reactivestreams")
dockerTestImplementation("org.mongodb:mongodb-driver-sync")

2
spring-boot-project/spring-boot-session-data-redis/build.gradle

@ -38,7 +38,9 @@ dependencies { @@ -38,7 +38,9 @@ dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-webflux"))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-session")))
dockerTestImplementation("com.redis:testcontainers-redis")
dockerTestImplementation("org.testcontainers:junit-jupiter")

2
spring-boot-project/spring-boot-session/build.gradle

@ -38,6 +38,7 @@ dependencies { @@ -38,6 +38,7 @@ dependencies {
testFixturesImplementation(project(":spring-boot-project:spring-boot-test"))
testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testFixturesImplementation("io.projectreactor:reactor-core")
testImplementation(project(":spring-boot-project:spring-boot-test"))
@ -45,6 +46,7 @@ dependencies { @@ -45,6 +46,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(project(":spring-boot-project:spring-boot-webflux"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testRuntimeOnly("ch.qos.logback:logback-classic")
}

1
spring-boot-project/spring-boot-test/build.gradle

@ -28,6 +28,7 @@ dependencies { @@ -28,6 +28,7 @@ dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.springframework:spring-test")
optional(project(":spring-boot-project:spring-boot-web-server"))
optional("com.fasterxml.jackson.core:jackson-databind")
optional("com.google.code.gson:gson")
optional("com.jayway.jsonpath:json-path")

9
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java

@ -31,7 +31,6 @@ import org.springframework.boot.SpringBootConfiguration; @@ -31,7 +31,6 @@ import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext;
import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AliasFor;
@ -155,8 +154,8 @@ public @interface SpringBootTest { @@ -155,8 +154,8 @@ public @interface SpringBootTest {
RANDOM_PORT(true),
/**
* Creates a (reactive) web application context without defining any
* {@code server.port=0} {@link Environment} property.
* Creates a web application context (reactive or servlet based) without defining
* any {@code server.port=0} {@link Environment} property.
*/
DEFINED_PORT(true),
@ -174,8 +173,8 @@ public @interface SpringBootTest { @@ -174,8 +173,8 @@ public @interface SpringBootTest {
}
/**
* Return if the environment uses an {@link ServletWebServerApplicationContext}.
* @return if an {@link ServletWebServerApplicationContext} is used.
* Return if the environment uses an embedded web server.
* @return if an embedded web server is used
*/
public boolean isEmbedded() {
return this.embedded;

4
spring-boot-project/spring-boot-tomcat/build.gradle

@ -32,7 +32,7 @@ configurations { @@ -32,7 +32,7 @@ configurations {
}
dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-web-server"))
api("org.apache.tomcat.embed:tomcat-embed-core") {
exclude group: "org.apache.tomcat", module: "tomcat-annotations-api"
}
@ -48,7 +48,7 @@ dependencies { @@ -48,7 +48,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("org.apache.httpcomponents.client5:httpclient5")

2
spring-boot-project/spring-boot-tx/src/test/java/org/springframework/boot/transaction/autoconfigure/TransactionManagerCustomizationAutoConfigurationTests.java

@ -40,7 +40,7 @@ class TransactionManagerCustomizationAutoConfigurationTests { @@ -40,7 +40,7 @@ class TransactionManagerCustomizationAutoConfigurationTests {
@Test
void autoConfiguresTransactionManagerCustomizers() {
this.contextRunner.run((context) -> {
this.contextRunner.withPropertyValues("spring.transaction.default-timeout=30s").run((context) -> {
TransactionManagerCustomizers customizers = context.getBean(TransactionManagerCustomizers.class);
assertThat(customizers).extracting("customizers")
.asInstanceOf(InstanceOfAssertFactories.LIST)

4
spring-boot-project/spring-boot-undertow/build.gradle

@ -26,7 +26,7 @@ plugins { @@ -26,7 +26,7 @@ plugins {
description = "Spring Boot Undertow"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-web-server"))
api("io.undertow:undertow-servlet")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
@ -35,7 +35,7 @@ dependencies { @@ -35,7 +35,7 @@ dependencies {
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
testImplementation("org.apache.httpcomponents.client5:httpclient5")
testImplementation("org.apache.tomcat.embed:tomcat-embed-jasper")

53
spring-boot-project/spring-boot-web-server/build.gradle

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "java-library"
id "java-test-fixtures"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Web Server"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.springframework:spring-web")
optional("io.projectreactor:reactor-core")
optional("jakarta.servlet:jakarta.servlet-api")
optional("org.springframework:spring-test")
testFixturesCompileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testFixturesCompileOnly("io.projectreactor:reactor-test")
testFixturesCompileOnly("io.projectreactor.netty:reactor-netty-http")
testFixturesCompileOnly("org.apache.httpcomponents.client5:httpclient5")
testFixturesCompileOnly("org.apache.tomcat.embed:tomcat-embed-jasper")
testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client")
testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client-transport")
testFixturesCompileOnly("jakarta.servlet:jakarta.servlet-api")
testFixturesCompileOnly("org.mockito:mockito-core")
testFixturesCompileOnly("org.springframework:spring-tx")
testFixturesCompileOnly("org.springframework:spring-webflux")
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
testImplementation("org.apache.tomcat.embed:tomcat-embed-core")
testImplementation("org.springframework:spring-webmvc")
testRuntimeOnly("ch.qos.logback:logback-classic")
}

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Compression.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Cookie.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Cookie.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Http2.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Http2.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/MimeMappings.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseException.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseException.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Shutdown.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Ssl.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Ssl.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServer.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServer.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerException.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerException.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/package-info.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/package-info.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/package-info.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/package-info.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/package-info.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/package-info.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/Session.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Session.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java

0
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/package-info.java → spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/package-info.java

13
spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring.factories

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
# Application Context Factories
org.springframework.boot.ApplicationContextFactory=\
org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContextFactory,\
org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContextFactory
# Application Context Initializers
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.web.server.PortInUseFailureAnalyzer,\
org.springframework.boot.web.server.context.MissingWebServerFactoryBeanFailureAnalyzer

2
spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring/aot.factories

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.boot.web.server.MimeMappings$MimeMappingsRuntimeHints

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/CompressionTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/CompressionTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java

188
spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/SpringApplicationWebServerTests.java

@ -0,0 +1,188 @@ @@ -0,0 +1,188 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.web.server;
import java.util.Iterator;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.testsupport.classpath.resources.WithResource;
import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext;
import org.springframework.boot.web.context.reactive.StandardReactiveWebEnvironment;
import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory;
import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext;
import org.springframework.boot.web.server.servlet.MockServletWebServerFactory;
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.PropertySource;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.test.context.support.TestPropertySourceUtils;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.StandardServletEnvironment;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link SpringApplication} with a {@link WebServer}.
*
* @author Andy wilkinson
*/
class SpringApplicationWebServerTests {
private String headlessProperty;
private ConfigurableApplicationContext context;
@BeforeEach
void storeAndClearHeadlessProperty() {
this.headlessProperty = System.getProperty("java.awt.headless");
System.clearProperty("java.awt.headless");
}
@AfterEach
void reinstateHeadlessProperty() {
if (this.headlessProperty == null) {
System.clearProperty("java.awt.headless");
}
else {
System.setProperty("java.awt.headless", this.headlessProperty);
}
}
@AfterEach
void cleanUp() {
if (this.context != null) {
this.context.close();
}
System.clearProperty("spring.main.banner-mode");
}
@Test
void defaultApplicationContextForWeb() {
SpringApplication application = new SpringApplication(ExampleWebConfig.class);
application.setWebApplicationType(WebApplicationType.SERVLET);
this.context = application.run();
assertThat(this.context).isInstanceOf(AnnotationConfigServletWebServerApplicationContext.class);
}
@Test
void defaultApplicationContextForReactiveWeb() {
SpringApplication application = new SpringApplication(ExampleReactiveWebConfig.class);
application.setWebApplicationType(WebApplicationType.REACTIVE);
this.context = application.run();
assertThat(this.context).isInstanceOf(AnnotationConfigReactiveWebServerApplicationContext.class);
}
@Test
void environmentForWeb() {
SpringApplication application = new SpringApplication(ExampleWebConfig.class);
application.setWebApplicationType(WebApplicationType.SERVLET);
this.context = application.run();
assertThat(this.context.getEnvironment()).isInstanceOf(StandardServletEnvironment.class);
assertThat(this.context.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment");
}
@Test
void environmentForReactiveWeb() {
SpringApplication application = new SpringApplication(ExampleReactiveWebConfig.class);
application.setWebApplicationType(WebApplicationType.REACTIVE);
this.context = application.run();
assertThat(this.context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class);
assertThat(this.context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment");
}
@Test
void webApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() {
ConfigurableApplicationContext context = new SpringApplication(ExampleWebConfig.class)
.run("--spring.main.web-application-type=servlet");
assertThat(context).isInstanceOf(WebApplicationContext.class);
assertThat(context.getEnvironment()).isInstanceOf(StandardServletEnvironment.class);
assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment");
}
@Test
void reactiveApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() {
ConfigurableApplicationContext context = new SpringApplication(ExampleReactiveWebConfig.class)
.run("--spring.main.web-application-type=reactive");
assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class);
assertThat(context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class);
assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment");
}
@Test
@WithResource(name = "application-withwebapplicationtype.properties",
content = "spring.main.web-application-type=reactive")
void environmentIsConvertedIfTypeDoesNotMatch() {
ConfigurableApplicationContext context = new SpringApplication(ExampleReactiveWebConfig.class)
.run("--spring.profiles.active=withwebapplicationtype");
assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class);
assertThat(context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class);
assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment");
}
@Test
void webApplicationSwitchedOffInListener() {
SpringApplication application = new SpringApplication(ExampleWebConfig.class);
application.addListeners((ApplicationListener<ApplicationEnvironmentPreparedEvent>) (event) -> {
assertThat(event.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment");
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(event.getEnvironment(), "foo=bar");
event.getSpringApplication().setWebApplicationType(WebApplicationType.NONE);
});
this.context = application.run();
assertThat(this.context.getEnvironment()).isNotInstanceOf(StandardServletEnvironment.class);
assertThat(this.context.getEnvironment().getProperty("foo")).isEqualTo("bar");
Iterator<PropertySource<?>> iterator = this.context.getEnvironment().getPropertySources().iterator();
assertThat(iterator.next().getName()).isEqualTo("configurationProperties");
assertThat(iterator.next().getName())
.isEqualTo(TestPropertySourceUtils.INLINED_PROPERTIES_PROPERTY_SOURCE_NAME);
}
@Configuration(proxyBeanMethods = false)
static class ExampleWebConfig {
@Bean
MockServletWebServerFactory webServer() {
return new MockServletWebServerFactory();
}
}
@Configuration(proxyBeanMethods = false)
static class ExampleReactiveWebConfig {
@Bean
MockReactiveWebServerFactory webServerFactory() {
return new MockReactiveWebServerFactory();
}
@Bean
HttpHandler httpHandler() {
return (serverHttpRequest, serverHttpResponse) -> Mono.empty();
}
}
}

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java

0
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java → spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save