tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r942797 - /tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
Date Mon, 10 May 2010 15:44:53 GMT
Author: markt
Date: Mon May 10 15:44:52 2010
New Revision: 942797

URL: http://svn.apache.org/viewvc?rev=942797&view=rev
Log:
Make sure Tomcat instance is closed down correctly (prevents warnings in the logs).

Modified:
    tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=942797&r1=942796&r2=942797&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Mon May 10 15:44:52
2010
@@ -104,11 +104,15 @@ public abstract class TomcatBaseTest ext
     
     @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);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message