Skip to content

Commit 0937362

Browse files
committed
Polish "Allow Tomcat be destroyed regardless of exceptions"
See gh-16892
1 parent 2b33e31 commit 0937362

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ protected void doPost(HttpServletRequest req,
526526
@Test
527527
public void exceptionThrownOnContextListenerDestroysServer() {
528528
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0) {
529+
529530
@Override
530531
protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
531532
try {
@@ -536,6 +537,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat) {
536537
.isEqualTo(LifecycleState.DESTROYED);
537538
}
538539
}
540+
539541
};
540542
assertThatExceptionOfType(WebServerException.class)
541543
.isThrownBy(() -> factory.getWebServer((context) -> context

0 commit comments

Comments
 (0)