RFR(s): 8169002: [TESTBUG] Several java/net/httpclient have undeclared dependency on java.logging module
Daniel Fuchs
daniel.fuchs at oracle.com
Tue Nov 1 17:53:01 UTC 2016
Hi Roger,
On 01/11/16 17:21, Roger Riggs wrote:
> Hi Sergei,
>
> I think it would be preferable to convert the tests to use
> System.getLogger.
> Is that possible?
Some of the tests want to configure the logging, rather
than simply produce traces - so they will need java.logging
to do that:
670 Logger logger = Logger.getLogger("com.sun.net.httpserver");
671 ConsoleHandler ch = new ConsoleHandler();
672 logger.setLevel(Level.ALL);
673 ch.setLevel(Level.ALL);
674 logger.addHandler(ch);
It's recommended to use System.Logger to log messages,
but you will have to use java.util.logging if you want to configure
the logging framework. Of course a library shouldn't do that,
but a test is well in its right to configure logging to make
sure the traces will appear in the log.
Unless you do want to run the test in a VM that does not have
java.logging linked in.
cheers,
-- daniel
>
> Thanks, Roger
>
>
> On 11/1/2016 1:15 PM, Sergei Kovalev wrote:
>> Hello all,
>>
>> Please review a small fix for tests.
>>
>> BugID: https://bugs.openjdk.java.net/browse/JDK-8169002
>> WebRev: http://cr.openjdk.java.net/~skovalev/8169002/webrev.00/
>>
>> Issue: Several tests from java/net/httpclient folder have undeclared
>> dependency on java.logging module. This issue leads the test to fail
>> in case module limitation.
>> Solution: added module declaration into jtreg header and organized
>> imports.
>>
>
More information about the net-dev
mailing list