RFR(s): 8169002: [TESTBUG] Several java/net/httpclient have undeclared dependency on java.logging module
Roger Riggs
Roger.Riggs at Oracle.com
Tue Nov 1 18:01:34 UTC 2016
Hi Daniel,
It seemed useful to be able to run the test in as many environments as
possible
though realistically java.util.logging may be there too.
I don't see that setting the logging levels is intrinsic to the tests
and would be used
for debugging so perhaps that function can be dropped or configured via the
java.util.logging.config.file system property if/when needed.
$.02, Roger
On 11/1/2016 1:53 PM, Daniel Fuchs wrote:
> 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.
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20161101/ab8d0b0c/attachment.html>
More information about the net-dev
mailing list