From e2ab05a7e396e37cfbc39539c051de25c6bfbdd7 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 10 May 2010 15:44:52 +0000 Subject: [PATCH] Make sure Tomcat instance is closed down correctly (prevents warnings in the logs). git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@942797 13f79535-47bb-0310-9956-ffa450edef68 --- test/org/apache/catalina/startup/TomcatBaseTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/org/apache/catalina/startup/TomcatBaseTest.java b/test/org/apache/catalina/startup/TomcatBaseTest.java index 08e5f3811..d1232f11c 100644 --- a/test/org/apache/catalina/startup/TomcatBaseTest.java +++ b/test/org/apache/catalina/startup/TomcatBaseTest.java @@ -104,11 +104,15 @@ public abstract class TomcatBaseTest extends TestCase { @Override public void tearDown() throws Exception { - // Some tests may call tomcat.destroy(). In which case, don't - // call stop() + // Some tests may call tomcat.destroy(), some tests may just call + // tomcat.stop(), smoe not call either method. Make sure that stop() & + // destroy() are called as necessary. if (tomcat.server != null && tomcat.server.getState() != LifecycleState.DESTROYED) { - tomcat.stop(); + if (tomcat.server.getState() != LifecycleState.STOPPED) { + tomcat.stop(); + } + tomcat.destroy(); } ExpandWar.delete(tempDir); } -- 2.11.0