1
0
- Refactor the setup of class loaders so that it is clearer what is
  going on
- For the Log4J tests, add the custom Appender implementation to
  whichever class loader Log4J is put in
- Set and reset the thread context class loader to more accurately
  simulate the environment of a servlet container.

build.xml:
- Implement the multi-classloader test scenarios for Log4J, equivalent
  to those for JDK 1.4.

We now have a robust testing environment to catch any possible regressions
when modifying the functionality (such as ripping out Log4jFactory, as
discussed on COMMONS-DEV).

I don't have time to do the corresponding test scenarios for Avalon LogKit,
but anyone who wants to do so is welcome to create them.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138965 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Craig R. McClanahan
2003-04-02 00:50:49 +00:00
parent 5347bd9e55
commit 7c71a7d917
3 changed files with 129 additions and 47 deletions

View File

@@ -3,7 +3,7 @@
<!--
"Logging" component of the Jakarta Commons Subproject
$Id: build.xml,v 1.31 2003/03/31 00:38:22 craigmcc Exp $
$Id: build.xml,v 1.32 2003/04/02 00:50:49 craigmcc Exp $
-->
@@ -236,16 +236,24 @@
<copy todir="${build.home}/tests" filtering="on">
<fileset dir="${test.home}" excludes="**/*.java"/>
</copy>
<jar jarfile="${build.home}/commons-${component.name}-appender.jar"
basedir="${build.home}/tests"
manifest="${build.home}/conf/MANIFEST.MF">
<include name="org/apache/commons/logging/log4j/CustomConfig.properties"
if="log4j.present"/>
<include name="org/apache/commons/logging/log4j/TestAppender.class"
if="log4j.present"/>
</jar>
<jar jarfile="${build.home}/commons-${component.name}-tests.jar"
basedir="${build.home}/tests"
manifest="${build.home}/conf/MANIFEST.MF">
manifest="${build.home}/conf/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"
manifest="${build.home}/conf/MANIFEST.MF">
manifest="${build.home}/conf/MANIFEST.MF">
<include name="org/apache/commons/logging/Wrapper.class"/>
<include name="org/apache/commons/logging/jdk14/TestHandler.class"
if="jdk.1.4.present"/>
@@ -478,6 +486,80 @@
<classpath refid="test.classpath.log4j"/>
</java>
<echo message="Hierarchy Configuration API (Log4J Auto-Recognized)"/>
<java classname="${test.wrapper}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="wrapper.hierarchy" value="API"/>
<sysproperty key="wrapper.junit" value="${junit.jar}"/>
<sysproperty key="wrapper.log4j" value="${log4j.jar}"/>
<sysproperty key="wrapper.target" value="${build.home}"/>
<sysproperty key="wrapper.testcase"
value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<classpath refid="test.classpath.wrap"/>
</java>
<echo message="Hierarchy Configuration API (Log4J LogFactoryImpl Selected)"/>
<java classname="${test.wrapper}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="wrapper.hierarchy" value="API"/>
<sysproperty key="wrapper.junit" value="${junit.jar}"/>
<sysproperty key="wrapper.log4j" value="${log4j.jar}"/>
<sysproperty key="wrapper.target" value="${build.home}"/>
<sysproperty key="wrapper.testcase"
value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.LogFactoryImpl"/>
<classpath refid="test.classpath.wrap"/>
</java>
<echo message="Hierarchy Configuration API (Log4J Log4JLogger Selected)"/>
<java classname="${test.wrapper}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="wrapper.hierarchy" value="API"/>
<sysproperty key="wrapper.junit" value="${junit.jar}"/>
<sysproperty key="wrapper.log4j" value="${log4j.jar}"/>
<sysproperty key="wrapper.target" value="${build.home}"/>
<sysproperty key="wrapper.testcase"
value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4JLogger"/>
<classpath refid="test.classpath.wrap"/>
</java>
<echo message="Hierarchy Configuration FULL (Log4J Auto-Recognized)"/>
<java classname="${test.wrapper}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="wrapper.hierarchy" value="FULL"/>
<sysproperty key="wrapper.junit" value="${junit.jar}"/>
<sysproperty key="wrapper.log4j" value="${log4j.jar}"/>
<sysproperty key="wrapper.target" value="${build.home}"/>
<sysproperty key="wrapper.testcase"
value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<classpath refid="test.classpath.wrap"/>
</java>
<echo message="Hierarchy Configuration FULL (Log4J LogFactoryImpl Selected)"/>
<java classname="${test.wrapper}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="wrapper.hierarchy" value="FULL"/>
<sysproperty key="wrapper.junit" value="${junit.jar}"/>
<sysproperty key="wrapper.log4j" value="${log4j.jar}"/>
<sysproperty key="wrapper.target" value="${build.home}"/>
<sysproperty key="wrapper.testcase"
value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.LogFactoryImpl"/>
<classpath refid="test.classpath.wrap"/>
</java>
<echo message="Hierarchy Configuration FULL (Log4J Log4JLogger Selected)"/>
<java classname="${test.wrapper}" fork="yes" failonerror="${test.failonerror}">
<sysproperty key="wrapper.hierarchy" value="FULL"/>
<sysproperty key="wrapper.junit" value="${junit.jar}"/>
<sysproperty key="wrapper.log4j" value="${log4j.jar}"/>
<sysproperty key="wrapper.target" value="${build.home}"/>
<sysproperty key="wrapper.testcase"
value="org.apache.commons.logging.log4j.CustomConfigTestCase"/>
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4JLogger"/>
<classpath refid="test.classpath.wrap"/>
</java>
</target>