--- Simon Kitching <[EMAIL PROTECTED]> wrote:
> On Mon, 2005-05-30 at 21:22 -0700, Brian Stansberry
> wrote:
> > I'm not sure if this is a flaw (maybe the child
> really
> > wanted jdk logging, and we're giving them log4j),
> but
> > basically we're discovering the log method made
> > available via the TCCL.
>
> I think that if log4j *can* be used, and we find it,
> then that is right.
> Autodiscovery is meant to find log4j before jdk14.
>
> And I'm not too bothered by discovering the "wrong"
> logging
> implementation anyway; users can always use a
> commons-logging.properties
> or a META-INF/services file to specify which logging
> lib they want if
> they really care.
>
> What's important is that the discovered logging lib
> *works* (doesn't
> throw an exception).
>
+1
> >
> > In any case, I don't think we can test for jdk or
> > SimpleLog being discovered; we can only test if
> > logging worked.
>
> Isn't it possible for the test to do this?
> if (running on jdk>= 1.4) {
> assertEquals(logObject.getClass(),
> "org.apache.commons.logging.impl.Jdk14Log");
> } else {
> assertEquals(logObject.getClass(),
> "org.apache.commons.logging.impl.SimpleLog");
> }
>
> After all, that's stating what we expect - that in
> the setup used by
> this test, we get logger Jdk14 or SimpleLog, and not
> Log4JLog. The only
> tricky bit is that the unit test currently doesn't
> have access to the
> Log object created, so it may mean a bit of
> refactoring of the test
> code.
>
Sorry, wasn't clear about what I meant. The test
classpath used in the ant build includes Log4j, so it
will be discovered (unless we create a special
classpath for this one test). In any case, whether or
not a particular adapter is discovered depends on
what's on the test classpath. We could have the test
analyze its classpath in order to determine what
should have been discovered, so I guess we *could*
test to see if the right one was discovered.
Brian
> Regards,
>
> Simon
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]