RFR: 7540: IItemCollectionJsonSerializerTest.java might fail on Windows due to line endings [v2]
Christoph Langer
clanger at openjdk.java.net
Wed Apr 27 20:32:56 UTC 2022
On Wed, 27 Apr 2022 16:35:01 GMT, Alex Ciminian <duke at openjdk.java.net> wrote:
>> Christoph Langer has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains one additional commit since the last revision:
>>
>> JMC-7540
>> Fix test IItemCollectionJsonSerializerTest.java
>
> core/tests/org.openjdk.jmc.flightrecorder.serializers.test/src/test/java/org/openjdk/jmc/flightrecorder/serializers/json/test/IItemCollectionJsonSerializerTest.java line 69:
>
>> 67: String actual = IItemCollectionJsonSerializer.toJsonString(testRecording);
>> 68:
>> 69: assertEquals(expected.replaceAll("\\r\\n", "\n"), actual.replaceAll("\\r\\n", "\n"));
>
> Sorry, I'm late to the party I wrote this test and I'm curious what the problem was here
>
> Did this test fail for you? I don't understand how it can be different on windows since the JSON file has unix line endings and the serialiser will output unix line endings.
Hm, it's been a while but obviously it failed for me. In the bug I've written: On Windows, the returned data from IItemCollectionJsonSerializer.toJsonString(testRecording) seems to have platform line endings. Are you sure that there should be unix line endings?
-------------
PR: https://git.openjdk.java.net/jmc/pull/370
More information about the jmc-dev
mailing list