1
0

Add basic tests for Log4J. Still need to add the multi-classloader

scenarios.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138960 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Craig R. McClanahan
2003-03-30 05:22:50 +00:00
parent 4ed6819dc3
commit e462bae3af
6 changed files with 723 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
<!--
"Logging" component of the Jakarta Commons Subproject
$Id: build.xml,v 1.27 2003/03/30 02:30:36 craigmcc Exp $
$Id: build.xml,v 1.28 2003/03/30 05:22:50 craigmcc Exp $
-->
@@ -103,6 +103,14 @@
<pathelement location="${junit.jar}"/>
</path>
<!-- Construct unit test classpath (Log4J tests) -->
<path id="test.classpath.log4j">
<pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/tests"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${log4j.jar}"/>
</path>
<!-- Construct unit test classpath (Minimal Wrapper) -->
<path id="test.classpath.wrap">
<pathelement location="${build.home}/commons-logging-wrapper.jar"/>
@@ -226,6 +234,8 @@
basedir="${build.home}/tests"
manifest="${conf.home}/MANIFEST.MF">
<exclude name="org/apache/commons/logging/Wrapper.class"/>
<exclude name="org/apache/commons/logging/jdk14/TestHandler.class"
if="jdk.1.4.present"/>
</jar>
<jar jarfile="${build.home}/commons-${component.name}-wrapper.jar"
basedir="${build.home}/tests"
@@ -291,7 +301,8 @@
<!-- ========== Unit Test Targets ========================================= -->
<target name="test" depends="compile.tests,test.jdk14" if="test.entry"
<target name="test" depends="compile.tests,test.jdk14,test.log4j
" if="test.entry"
description="Run all unit test cases">
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="${test.entry}"/>
@@ -417,4 +428,54 @@
</target>
<target name="test.log4j" depends="compile.tests" if="log4j.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.log4j"/>
</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.log4j"/>
</java>
<echo message="Default Configuration (Log4J Log4JLogger Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4JLogger"/>
<arg value="org.apache.commons.logging.log4j.DefaultConfigTestCase"/>
<classpath refid="test.classpath.log4j"/>
</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.log4j"/>
</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.log4j"/>
</java>
<echo message="Custom Configuration (Log4J Log4JLogger Selected)"/>
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4JLogger"/>
<arg value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<classpath refid="test.classpath.log4j"/>
</java>
</target>
</project>