Author: kkolinko
Date: Sun May 11 11:47:23 2014
New Revision: 1593780

URL: http://svn.apache.org/r1593780
Log:
Merged r1593773 from tomcat/trunk:
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 tests in Tomcat 8 are 
configured separately.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/BUILDING.txt
    tomcat/tc7.0.x/trunk/build.xml
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1593773

Modified: tomcat/tc7.0.x/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/BUILDING.txt?rev=1593780&r1=1593779&r2=1593780&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/BUILDING.txt (original)
+++ tomcat/tc7.0.x/trunk/BUILDING.txt Sun May 11 11:47:23 2014
@@ -363,7 +363,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:
 
@@ -374,7 +380,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
@@ -382,17 +388,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/tc7.0.x/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/build.xml?rev=1593780&r1=1593779&r2=1593780&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/build.xml (original)
+++ tomcat/tc7.0.x/trunk/build.xml Sun May 11 11:47:23 2014
@@ -69,6 +69,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"/>
@@ -1350,6 +1351,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}" />
 
@@ -1358,13 +1360,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/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1593780&r1=1593779&r2=1593780&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java 
(original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java 
Sun May 11 11:47:23 2014
@@ -124,8 +124,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/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1593780&r1=1593779&r2=1593780&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun May 11 11:47:23 2014
@@ -329,6 +329,10 @@
         Update package renamed Apache Commons BCEL to r1593495 to pick up some
         additional changes for Java 7 support and some code clean up. (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