Hello Andy,
At 02:19 AM 12/11/2004, Andy McBride wrote:
I'm playing with embedding tomcat for integration testing at the moment. Got tomcat-embedded-5.5.4 working in the tests ant build without too much trouble (Cheers Yoav) but it requires jdk1.4 so I'm looking at a way to embed and use different app-servers (jetty/tomcat 4.x, tomcat 5.x) transparently to the unit test.
If testing with Tomcat requires JDK 1.4, then we could run all the web server integration tests under JDK 1.4. (We could for example create a new ant build file under LOG4J_HOME/tests/.)
The next part of the challenge will be actually verifying that all the relevant components of log4j release resources correctly under app-server life-cycle events.
We can't possibly tests all log4j components. I see more value in few but serious test than a bunch of superficial ones. There are two required tests. First, we must test the correct recycling of a web-app using log4j with a simple set up, say a single FileAppender using PatternLayout configured through a log4j.properties file. This test should verify that the thread context class loader (TCL) for the old version of the web-abb is really garbage collected. (If I am not mistaken the garbage collection of the TCL can tracked using a java.ref.PhantomReferece.)
Second, before strongly pushing for wide-spread use of ContextJNDISelector, we should make sure it works perfectly. For instance, we should check that loggers created by the application server, e.g. Tomcat, and those created by the web-application are always created using the correct repository. Since the order in which classes are loaded into memory may influence (it should not but you never know unless you check) the choice of ContextJNDISelector, we must check that class static loggers as well as instance loggers are attached to the correct repository.
I deem these two tests to be critical.
Cheers
Andy
-- Ceki Gülcü
The complete log4j manual: http://qos.ch/log4j/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]