Author: kkolinko
Date: Sun May 11 11:02:53 2014
New Revision: 1593773

URL: http://svn.apache.org/r1593773
Log:
In tests: allow to configure directory where JUnit reports and access log are 
written to.
This is useful for Apache Gump, where BIO, NIO and NIO2 test runs are 
configured separately.

Modified:
    tomcat/trunk/BUILDING.txt
    tomcat/trunk/build.xml
    tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/BUILDING.txt?rev=1593773&r1=1593772&r2=1593773&view=diff
==============================================================================
--- tomcat/trunk/BUILDING.txt (original)
+++ tomcat/trunk/BUILDING.txt Sun May 11 11:02:53 2014
@@ -352,7 +352,13 @@ For example:
 
 (7.3) Other configuration options
 
- 1. It is possible to enable generation of access log file when the tests
+ 1. It is possible to configure the directory where JUnit reports are
+ written to. It is configured by "test.reports" property. The default
+ value is
+
+        output/build/logs
+
+ 2. It is possible to enable generation of access log file when the tests
  are run. This is off by default and can be enabled by the following
  property:
 
@@ -363,7 +369,7 @@ For example:
 
         output/build/logs
 
- 2. The testsuite respects logging configuration as configured by
+ 3. The testsuite respects logging configuration as configured by
  ${tomcat.source}/conf/logging.properties
 
  The log files will be written to the temporary directory used by the
@@ -371,17 +377,24 @@ For example:
 
         output/test-tmp/logs
 
- 3. It is possible to configure formatter used by JUnit reports. For
- example the following property disables generation of separate report
+ 4. It is possible to configure formatter used by JUnit reports.
+ Configuration properties are "junit.formatter.type",
+ "junit.formatter.extension" and "junit.formatter.usefile".
+
+ For example the following property disables generation of separate report
  files:
 
         junit.formatter.usefile=false
 
- 4. Optional support is provided for the Cobertura code coverage tool. It
+ 5. Optional support is provided for the Cobertura code coverage tool. It
  can be enabled using the following property:
 
         test.cobertura=true
 
+ The report files by default are written to
+
+        output/coverage
+
 * NOTE: Cobertura is licensed under GPL v2 with parts of it being under
   Apache License v1.1. See http://cobertura.sf.net for details. Using it
   during Tomcat build is optional and is off by default.

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1593773&r1=1593772&r2=1593773&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Sun May 11 11:02:53 2014
@@ -70,6 +70,7 @@
   <property name="tomcat.src.jars"       value="${tomcat.output}/src-jars"/>
   <property name="test.classes"          value="${tomcat.output}/testclasses"/>
   <property name="test.temp"             value="${tomcat.output}/test-tmp"/>
+  <property name="test.reports"          value="${tomcat.build}/logs"/>
   <property name="test.apr.loc"          value="${tomcat.build}/bin/native"/>
   <!-- base directory for jdbc-pool -->
   <property name="tomcat.jdbc.dir"       value="${basedir}/modules/jdbc-pool"/>
@@ -1373,6 +1374,7 @@
         <sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
         <sysproperty key="tomcat.test.protocol" value="@{protocol}" />
         <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
+        <sysproperty key="tomcat.test.reports" value="${test.reports}" />
         <!-- File for Cobertura to write coverage results to -->
         <sysproperty key="net.sourceforge.cobertura.datafile" 
file="${cobertura.datafile}" />
 
@@ -1381,13 +1383,13 @@
                    extension="@{extension}${junit.formatter.extension}" />
 
         <!-- If test.entry is defined, run a single test, otherwise run all 
valid tests -->
-        <test todir="${tomcat.build}/logs" name="${test.entry}"
+        <test todir="${test.reports}" name="${test.entry}"
               if="test.entry" unless="test.entry.methods"
            />
-        <test todir="${tomcat.build}/logs" name="${test.entry}" 
methods="${test.entry.methods}"
+        <test todir="${test.reports}" name="${test.entry}" 
methods="${test.entry.methods}"
               if="test.entry.methods"
            />
-        <batchtest todir="${tomcat.build}/logs" unless="test.entry">
+        <batchtest todir="${test.reports}" unless="test.entry">
           <fileset dir="test" >
             <!-- Include all by default -->
             <include name="${test.name}" />

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=1593773&r1=1593772&r2=1593773&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Sun May 
11 11:02:53 2014
@@ -126,8 +126,14 @@ public abstract class TomcatBaseTest ext
         accessLogEnabled = Boolean.parseBoolean(
             System.getProperty("tomcat.test.accesslog", "false"));
         if (accessLogEnabled) {
+            String accessLogDirectory = System
+                    .getProperty("tomcat.test.reports");
+            if (accessLogDirectory == null) {
+                accessLogDirectory = new File(getBuildDirectory(), "logs")
+                        .toString();
+            }
             AccessLogValve alv = new AccessLogValve();
-            alv.setDirectory(getBuildDirectory() + "/logs");
+            alv.setDirectory(accessLogDirectory);
             alv.setPattern("%h %l %u %t \"%r\" %s %b %I %D");
             tomcat.getHost().getPipeline().addValve(alv);
         }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1593773&r1=1593772&r2=1593773&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Sun May 11 11:02:53 2014
@@ -382,6 +382,10 @@
         Update package renamed Apache Commons Pool2 and DBCP2 to r1593563 to
         pick various bug fixes. (markt)
       </update>
+      <add>
+        In tests: allow to configure directory where JUnit reports and access
+        log are written to. (kkolinko)
+      </add>
     </changelog>
   </subsection>
 </section>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to