Make sure Tomcat instance is closed down correctly (prevents warnings in the logs).
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 10 May 2010 15:44:52 +0000 (15:44 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 10 May 2010 15:44:52 +0000 (15:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@942797 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/startup/TomcatBaseTest.java

index 08e5f38..d1232f1 100644 (file)
@@ -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);
     }