RFR (XS) 8202360: [TESTBUG] runtime/LoadClass/TestResize.java needs to print output when it fails

Gerard Ziemski gerard.ziemski at oracle.com
Tue May 29 15:36:46 UTC 2018


> On May 28, 2018, at 6:05 PM, David Holmes <david.holmes at oracle.com> wrote:

trimmed…


>>> String already has a contains method you don't need to write your own helper.
>> String.contains(CharSequence s) API takes CharSequence, not String.
> 
> A String is a CharSequence (as is a StringBuffer, StringBuilder).

Learned something new, fixed.


>>> 
>>> I don't see why you stopped using BufferedReader to read each line, and replaced with Scanner.
>> Personally, I find it simpler to convert the entire output into String, which then can be tokenized into lines, which then can be looked at one at a time in a simple “for loop”. This also avoids the issue of remembering to consume all the output to unblock the process.
> 
> Then you could just use OutputAnalyzer which already provides the output as a String that you can either parse or search.

Now that you told me this I had to simplify the test by using the OutputAnalyzer.


https://bugs.openjdk.java.net/browse/JDK-8202360
http://cr.openjdk.java.net/~gziemski/8202360_rev6


cheers


More information about the hotspot-runtime-dev mailing list