RFR (S): 8072687: Update OutputAnalyzer to work with files

Dmitry Fazunenko dmitry.fazunenko at oracle.com
Tue Feb 17 18:56:44 UTC 2015


Hi Staffan,

For me it's not clear why the constructor taking a String argument sets 
both stderr and stdout to the same value...
But I don't see any reason to update this behavior and break compatibility.
So I would agree, that the new constructor should be consistent with the 
existing one and set both out and err to the same string.

Thanks,
Dima



On 17.02.2015 20:39, Staffan Larsen wrote:
> There is constructor that takes a String argument. That constructor sets both stderr and stdout to that same String. Your constructor behaves differently and only sets stdout to the contents of the file. I have no idea why the existing constructor does what it does, but it would be good if the new and old had the same behavior. I haven’t looked at the use cases for the existing constructor.
>
> /S
>
>> On 17 feb 2015, at 16:58, denis kononenko <denis.kononenko at oracle.com> wrote:
>>
>> Hi All,
>>
>> Could you please review a small change of OutputAnalyzer class from testlibrary.
>>
>> Webrev link: http://cr.openjdk.java.net/~dfazunen/dkononen/8072687/webrev.00/
>> Bug id: https://bugs.openjdk.java.net/browse/JDK-8072687
>> Testing: automated
>> Description:
>>
>> The purpose of this change is to extend the functionality of OutputAnalyzer by adding ability to read output from a file. Sometimes we have to analyze output written to a file (test data, logs, etc.). In that case we have to read it as a string and pass it into OutputAnalyzer's constructor (it could be done in several different ways). It would be very convenient to put this code directly into OutputAnalyzer. This would allow to make further tests code more cleaner and less error prone.
>>
>> The change consist of two parts:
>> 1) The change: OutputAnalyzer.java, added a new constructor that accepts File;
>> 2) The tests: FileOutputAnalyzerTests.java, very basic tests on reading functionality.
>>
>> Thank you,
>> Denis.
>>
>>



More information about the hotspot-dev mailing list