On 9/5/06, Paulex Yang wrote:

Stepan Mishura wrote:
> Paulex, thanks for your patience and answers.
>
> Yes, Sun's JRE sets root logger's level according to
> 'lib/logging.properties'. Also specifying the level for root logger in
> j.u.l.config.file doesn't help. (I assumed before that a JRE respects my
> "lovely" custom LogManager settings :-(! )
>
> OK. Let's return to the initial issue: how to run logging tests without
> changing JRE config files?
>
> I still believe that there should be some elegant way for testing
logging
> implementation without touching JRE files.
I agreed this is not acceptable. AFAIK current LogManagerTest has used a
MockLogManager in most test cases, so the migration should be relatively
easy.
> For example, what
> about developing custom LogManager for testing? The testing manager will
> work in 2 modes: default configuration and custom configuration. A
> test will
> have a hook to switch testing manager's mode. The first configuration is
> read from JRE config files (by j.u.l.LogManager implementation) and the
> second one will be fully controlled by a test and is set by the test
> via some manager's method (say readConfiguration(InputStream)). Does
this
> sound crazy?
Maybe we just need one Support_Exec() invocation to verify if the
LogManager reads the default logging
properties(jre/lib/logging.properties) correctly(which should be
straightforward by also loading and parsing that properties in test
codes), for other tests, we always use customized LogManager or
configuration files. If you are fine with this, I'm volunteer to
refactor the tests.

Agree with this approach.

Thanks,
Stepan

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to