RFR 8159126 Add test to validate DriverManager.println output when DriverManager is initially loaded
Lance Andersen
lance.andersen at oracle.com
Mon Sep 12 18:35:51 UTC 2016
> On Sep 12, 2016, at 1:55 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
>
>> On 12 Sep 2016, at 10:15, Lance Andersen <lance.andersen at oracle.com <mailto:lance.andersen at oracle.com>> wrote:
>>>
>>> Suggestion:
>>>
>>> 70 try (BufferedReader reader = new BufferedReader(new CharArrayReader(cw.toCharArray()))) {
>>> 71 boolean result
>>> 72 = reader.lines().anyMatch(
>>> 73 line -> line.matches(".*JDBC DriverManager initialized.*"));
>>> 74 assertFalse(result);
>>>
>>>
>>> Change anyMatch, to noneMatch, and assertTrue (note if the stream is empty none is “vacuously” satisfied and will return true).
>>
>> Thank you Paul. I can make that change, was not sure (if one was faster than the other)
>>
>
> Both will short-circuiting when the predicate returns true, speed-wise it should not be an issue.
Okie dokie, thank you for the clarification
> Arguably, noneMatch better expresses the intent of that is being tested.
Fair point.
Updated the webrev: http://cr.openjdk.java.net/~lancea/8159126/webrev.01/ <http://cr.openjdk.java.net/~lancea/8159126/webrev.01/>
Waiting for JPRT to also finish, clean run (as expected) on my Mac
>
> Paul.
<http://oracle.com/us/design/oracle-email-sig-198324.gif>
<http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
<http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>
More information about the core-libs-dev
mailing list