Author: kkolinko
Date: Mon Oct 27 21:18:21 2014
New Revision: 1634690

URL: http://svn.apache.org/r1634690
Log:
Log the current test name when the test starts.
It makes reading the log files easier.

Modified:
    tomcat/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java?rev=1634690&r1=1634689&r2=1634690&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java Mon Oct 
27 21:18:21 2014
@@ -24,6 +24,8 @@ import static org.junit.Assert.fail;
 
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.TestName;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -50,6 +52,12 @@ public abstract class LoggingBaseTest {
     private List<File> deleteOnTearDown = new ArrayList<>();
 
     /**
+     * Provides name of the currently executing test method.
+     */
+    @Rule
+    public final TestName testName = new TestName();
+
+    /**
      * Helper method that returns the directory where Tomcat build resides. It
      * is used to access resources that are part of default Tomcat deployment.
      * E.g. the examples webapp.
@@ -104,6 +112,7 @@ public abstract class LoggingBaseTest {
 
         // Get log instance after logging has been configured
         log = LogFactory.getLog(getClass());
+        log.info("Starting test case [" + testName.getMethodName() + "]");
     }
 
     @After

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1634690&r1=1634689&r2=1634690&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Oct 27 21:18:21 2014
@@ -352,6 +352,10 @@
         pick up the Windows binaries that are based on OpenSSL 1.0.1j and APR
         1.5.1. (markt)
       </update>
+      <scode>
+        In Tomcat tests: log name of the current test method at start time.
+        (kkolinko) 
+      </scode>
     </changelog>
   </subsection>
 </section>



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

Reply via email to