zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject svn commit: r1680995 - in /zookeeper/branches/branch-3.5: CHANGES.txt README_packaging.txt build.xml
Date Fri, 22 May 2015 05:25:54 GMT
Author: rakeshr
Date: Fri May 22 05:25:54 2015
New Revision: 1680995

URL: http://svn.apache.org/r1680995
Log:
ZOOKEEPER-2191: Continue supporting prior Ant versions that don't implement the threads attribute
for the JUnit task (Chris Nauroth via rakeshr)

Modified:
    zookeeper/branches/branch-3.5/CHANGES.txt
    zookeeper/branches/branch-3.5/README_packaging.txt
    zookeeper/branches/branch-3.5/build.xml

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1680995&r1=1680994&r2=1680995&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Fri May 22 05:25:54 2015
@@ -142,6 +142,9 @@ IMPROVEMENTS:
   ZOOKEEPER-2126 Improve exit log messsage of EventThread and SendThread by
   adding SessionId (surendra singh lilhore via rakeshr)
 
+  ZOOKEEPER-2191: Continue supporting prior Ant versions that don't implement the
+  threads attribute for the JUnit task (Chris Nauroth via rakeshr)
+
 Release 3.5.0 - 8/4/2014
 
 NEW FEATURES:

Modified: zookeeper/branches/branch-3.5/README_packaging.txt
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/README_packaging.txt?rev=1680995&r1=1680994&r2=1680995&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/README_packaging.txt (original)
+++ zookeeper/branches/branch-3.5/README_packaging.txt Fri May 22 05:25:54 2015
@@ -3,6 +3,7 @@ README file for Packaging Notes
 Requirement
 -----------
 
+ant (recommended version 1.9.4 or later for concurrent JUnit test execution)
 gcc, cppunit and python-setuptools are required to build 
 C and python bindings.
 

Modified: zookeeper/branches/branch-3.5/build.xml
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/build.xml?rev=1680995&r1=1680994&r2=1680995&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/build.xml (original)
+++ zookeeper/branches/branch-3.5/build.xml Fri May 22 05:25:54 2015
@@ -1292,24 +1292,62 @@ xmlns:maven="antlib:org.apache.maven.art
         </copy>
     </target>
 
-    <condition property="quicktest">
-      <and>
-        <equals arg1="${test.quick}" arg2="yes"/>
-        <not>
-          <isset property="testcase"/>
-        </not>
-      </and>
-    </condition>
-    <condition property="fulltest">
-      <and>
-        <equals arg1="${test.quick}" arg2="no"/>
-        <not>
-          <isset property="testcase"/>
-        </not>
-      </and>
-    </condition>
+    <target name="junit-init" depends="test-category">
+      <condition property="quicktest">
+        <and>
+          <equals arg1="${test.quick}" arg2="yes"/>
+          <not>
+            <isset property="testcase"/>
+          </not>
+        </and>
+      </condition>
+      <condition property="fulltest">
+        <and>
+          <equals arg1="${test.quick}" arg2="no"/>
+          <not>
+            <isset property="testcase"/>
+          </not>
+        </and>
+      </condition>
+      <condition property="ant.supports.concurrent.junit.processes">
+        <antversion atleast="1.9.4" />
+      </condition>
+      <property name="build.test.dir" value="${test.tmp.dir}" />
+      <property name="test.data.dir" value="${test.data.dir}" />
+      <property name="log4j.configuration"
+                value="file:${basedir}/conf/log4j.properties" />
+      <!-- superDigest is used by the tests/main code. If this is not set
+           as part of starting the jvm there is no guarantee that the static
+           initializers in the java code will see this (esp when running
+           with junit fork mode set to "once")-->
+      <property name="zookeeper.DigestAuthenticationProvider.superDigest"
+                value="super:D/InIHSb7yEEbrWz8b9l71RjZJU=" />
+      <propertyset id="junit.sys.properties">
+        <propertyref name="build.test.dir" />
+        <propertyref name="test.data.dir" />
+        <propertyref name="log4j.configuration" />
+        <propertyref name="zookeeper.DigestAuthenticationProvider.superDigest" />
+      </propertyset>
+      <path id="junit.classpath">
+        <path refid="test.java.classpath" />
+        <pathelement path="${test.java.classes}" />
+      </path>
+      <fileset id="quicktest.files" dir="${test.src.dir}">
+        <include name="**/*${test.category}Test.java" />
+        <exclude name="**/*HammerTest.java" />
+      </fileset>
+      <fileset id="fulltest.files" dir="${test.src.dir}">
+        <include name="**/*${test.category}Test.java" />
+      </fileset>
+      <fileset id="testcase.files" dir="${test.src.dir}">
+        <include name="**/${testcase}.java" />
+      </fileset>
+    </target>
+
+    <target name="junit.run" depends="junit-init,junit.run-single,junit.run-concurrent"
/>
 
-    <target name="junit.run">
+    <target name="junit.run-concurrent" if="ant.supports.concurrent.junit.processes">
+        <echo>Running ${test.junit.threads} concurrent JUnit processes.</echo>
         <junit showoutput="${test.output}"
                printsummary="${test.junit.printsummary}"
                haltonfailure="${test.junit.haltonfailure}"
@@ -1319,35 +1357,44 @@ xmlns:maven="antlib:org.apache.maven.art
                maxmemory="${test.junit.maxmem}"
                dir="${test.java.build.dir}" timeout="${test.timeout}"
                errorProperty="tests.failed" failureProperty="tests.failed">
-          <sysproperty key="build.test.dir" value="${test.tmp.dir}" />
-          <sysproperty key="test.data.dir" value="${test.data.dir}" />
-          <sysproperty key="log4j.configuration"
-                       value="file:${basedir}/conf/log4j.properties" />
-          <!-- superDigest is used by the tests/main code. If this is not set
-               as part of starting the jvm there is no guarantee that the static
-               initializers in the java code will see this (esp when running
-               with junit fork mode set to "once")-->
-          <sysproperty key="zookeeper.DigestAuthenticationProvider.superDigest"
-                       value="super:D/InIHSb7yEEbrWz8b9l71RjZJU=" />
+          <syspropertyset refid="junit.sys.properties" />
           <sysproperty key="test.junit.threads" value="${test.junit.threads}" />
-          <classpath refid="test.java.classpath"/>
-          <classpath>
-            <pathelement path="${test.java.classes}" />
-          </classpath>
+          <classpath refid="junit.classpath" />
+          <formatter type="${test.junit.output.format}" />
+          <batchtest todir="${test.log.dir}" if="quicktest">
+            <fileset refid="quicktest.files" />
+          </batchtest>
+          <batchtest todir="${test.log.dir}" if="fulltest">
+            <fileset refid="fulltest.files" />
+          </batchtest>
+          <batchtest todir="${test.log.dir}" if="testcase">
+            <fileset refid="testcase.files" />
+          </batchtest>
+        </junit>
+        <fail if="tests.failed">Tests failed!</fail>
+    </target>
+
+    <target name="junit.run-single" unless="ant.supports.concurrent.junit.processes">
+        <echo>Running single JUnit process.  Upgrade to Ant 1.9.4 or later to run multiple
JUnit processes.</echo>
+        <junit showoutput="${test.output}"
+               printsummary="${test.junit.printsummary}"
+               haltonfailure="${test.junit.haltonfailure}"
+               fork="yes"
+               forkmode="${test.junit.fork.mode}"
+               maxmemory="${test.junit.maxmem}"
+               dir="${test.java.build.dir}" timeout="${test.timeout}"
+               errorProperty="tests.failed" failureProperty="tests.failed">
+          <syspropertyset refid="junit.sys.properties" />
+          <classpath refid="junit.classpath" />
           <formatter type="${test.junit.output.format}" />
           <batchtest todir="${test.log.dir}" if="quicktest">
-            <fileset dir="${test.src.dir}">
-              <include name="**/*${test.category}Test.java"/>
-              <exclude name="**/*HammerTest.java"/>
-            </fileset>
+            <fileset refid="quicktest.files" />
           </batchtest>
           <batchtest todir="${test.log.dir}" if="fulltest">
-            <fileset dir="${test.src.dir}">
-              <include name="**/*${test.category}Test.java"/>
-            </fileset>
+            <fileset refid="fulltest.files" />
           </batchtest>
           <batchtest todir="${test.log.dir}" if="testcase">
-            <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
+            <fileset refid="testcase.files" />
           </batchtest>
         </junit>
         <fail if="tests.failed">Tests failed!</fail>



Mime
View raw message