1
0

log4j tests now all work fine with <batchtest> so remove special case code for log4j.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@209738 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Kitching
2005-07-08 11:46:41 +00:00
parent 697b414639
commit 72a6e4f9f6

145
build.xml
View File

@@ -140,7 +140,14 @@
<!-- ========== Test Execution Defaults =================================== --> <!-- ========== Test Execution Defaults =================================== -->
<!-- Construct unit test classpath (generic tests) --> <!--
- Construct unit test classpath (generic tests).
-
- Note that unit tests that use the PathableTestSuite approach don't need
- any of this (except junit). However unit tests that don't use PathableTestSuite
- to configure their classpath will need the basic classes to be provided
- via this mechanism.
-->
<path id="test.classpath"> <path id="test.classpath">
<pathelement location="${build.home}/classes"/> <pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/tests"/> <pathelement location="${build.home}/tests"/>
@@ -593,12 +600,8 @@ limitations under the License.--&gt;'>
<!-- ========== Unit Test Targets ========================================= --> <!-- ========== Unit Test Targets ========================================= -->
<target name="test"
depends="log4j12-test-warning, compile.tests, testall, test.log4j"/>
<!-- <!--
- Target to run all unit tests (except log4j tests for now). - Target to run all unit tests.
- -
- The batchtest task auto-detects what tests are available without - The batchtest task auto-detects what tests are available without
- any need to define TestSuite objects in the code to compose - any need to define TestSuite objects in the code to compose
@@ -615,7 +618,7 @@ limitations under the License.--&gt;'>
- ant -Dtestmatch=**/FooTestCase testall - ant -Dtestmatch=**/FooTestCase testall
--> -->
<target name="testall" depends="compile.tests" <target name="test" depends="log4j12-test-warning, compile.tests"
description="Run all unit tests"> description="Run all unit tests">
<echo message="Test output can be found in directory ${build.home}/test-reports."/> <echo message="Test output can be found in directory ${build.home}/test-reports."/>
<delete dir="${build.home}/test-reports"/> <delete dir="${build.home}/test-reports"/>
@@ -655,15 +658,6 @@ limitations under the License.--&gt;'>
<batchtest todir="${build.home}/test-reports"> <batchtest todir="${build.home}/test-reports">
<fileset dir="${build.home}/tests"> <fileset dir="${build.home}/tests">
<include name="${testmatch}.class"/> <include name="${testmatch}.class"/>
<!--
- Because we have two possible log4j jar files we
- can't include them in the system classpath, and
- so can't run the log4j tests here until after
- those TestCase classes have been converted over
- to using the PathableTestSuite approach.
-->
<exclude name="**/log4j/*"/>
</fileset> </fileset>
</batchtest> </batchtest>
</junit> </junit>
@@ -673,123 +667,4 @@ limitations under the License.--&gt;'>
</fail> </fail>
</target> </target>
<target name="test.log4j" depends="compile.tests" if="log4j12.present"
description="Run unit tests specific to Log4J logging">
<echo message="Default Configuration (Log4J Auto-Recognized)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.DefaultConfigTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Default Configuration (Log4J LogFactoryImpl Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.LogFactoryImpl"/>
<arg value="org.apache.commons.logging.log4j.DefaultConfigTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Default Configuration (Log4J Log4J12Logger Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4J12Logger"/>
<arg value="org.apache.commons.logging.log4j.DefaultConfigTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Custom Configuration (Log4J Auto-Recognized)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Custom Configuration (Log4J LogFactoryImpl Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.LogFactoryImpl"/>
<arg value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Custom Configuration (Log4J Log4J12Logger Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4J12Logger"/>
<arg value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Basic Operations"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4J12Logger"/>
<arg value="org.apache.commons.logging.BasicOperationsTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Hierarchy Configuration API (Log4J Auto-Recognized)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigAPITestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Hierarchy Configuration API (Log4J LogFactoryImpl Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigAPITestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.LogFactoryImpl"/>
</java>
<echo message="Hierarchy Configuration API (Log4J Log4J12Logger Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigAPITestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4J12Logger"/>
</java>
<echo message="Hierarchy Configuration FULL (Log4J Auto-Recognized)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigFullTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
</java>
<echo message="Hierarchy Configuration FULL (Log4J LogFactoryImpl Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigFullTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.LogFactoryImpl"/>
</java>
<echo message="Hierarchy Configuration FULL (Log4J Log4J12Logger Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="org.apache.commons.logging.log4j.CustomConfigFullTestCase"/>
<classpath refid="test.classpath.log4j12"/>
<syspropertyset refid="test-lib-props"/>
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4J12Logger"/>
</java>
</target>
</project> </project>