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

@@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/test/org/apache/commons/logging/log4j/CustomConfigTestCase.java,v 1.1 2003/03/30 05:22:50 craigmcc Exp $
* $Revision: 1.1 $
* $Date: 2003/03/30 05:22:50 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/test/org/apache/commons/logging/log4j/CustomConfigTestCase.java,v 1.2 2003/04/02 00:50:49 craigmcc Exp $
* $Revision: 1.2 $
* $Date: 2003/04/02 00:50:49 $
*
* ====================================================================
*
@@ -85,7 +85,7 @@ import org.apache.log4j.spi.LoggingEvent;
* logger configured per the configuration properties.</p>
*
* @author Craig R. McClanahan
* @version $Revision: 1.1 $ $Date: 2003/03/30 05:22:50 $
* @version $Revision: 1.2 $ $Date: 2003/04/02 00:50:49 $
*/
public class CustomConfigTestCase extends DefaultConfigTestCase {
@@ -235,7 +235,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
protected void checkLoggingEvents(boolean thrown) {
Iterator events = appender.events();
for (int i = 0; i < testMessages.length; i++) {
assertTrue(events.hasNext());
assertTrue("Logged event " + i + " exists",events.hasNext());
LoggingEvent event = (LoggingEvent) events.next();
assertEquals("LoggingEvent level",
testLevels[i], event.getLevel());