RFR: 8339513: [TestBug] Convert fxml tests to JUnit 5 [v2]

Kevin Rushforth kcr at openjdk.org
Mon Sep 16 15:11:17 UTC 2024


On Mon, 16 Sep 2024 13:56:09 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Ajit Ghaisas has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Formatting fixes
>
> Marked as reviewed by kcr (Lead).

> @kevinrushforth : assertXXX with strings will most certainly fail during the GHA run, unless the message is exactly the same as the expected or observed parameter, in which case it is probably ok...

Indeed, that is what would almost certainly happen. There is a (completely contrived) case where it will render the assert useless. If the message string is identical to the  "expected" string (in which case, why would you bother with a message string), like this:


    assertEquals("some expected string", "some expected string", actualValue);


then changing the above case to a JUnit 5 `assertEquals` will cause the test to always pass (the comparison will be done on the first two arguments and "actualValue" will be the message string). I admit that this is so artificial as to be not really worth worrying about.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1564#issuecomment-2353197080


More information about the openjfx-dev mailing list