On Tue, 28 Apr 2026 09:48:26 GMT, sstremler <[email protected]> wrote:

>> Refactor stream-related tests from TestNG to JUnit.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> sstremler has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Delete unnecessary whitespace
>    
>    Co-authored-by: Andrey Turbanov <[email protected]>
>  - Delete unnecessary whitespace
>    
>    Co-authored-by: Andrey Turbanov <[email protected]>

Hi, thanks for looking into this.

There is a significant number of changes, even though most of them look 
mechanical.  I am only familiar with the NetworkInterface test so getting more 
reviewers to look at this would be good. In particular the changes to 
`java.util.stream` tests and the `bootlib` test library.

Usually migrating from TestNG to JUnit requires swapping the argument order in 
`assertEquals` in order to avoid having confusing error messages if the test 
fails. However some of the tests seem to have had them in the wrong order 
originally, and thus seem to not require the swap. In addition tests using 
jdk.test.lib.Asserts, if moved to using the jupiter equivalent, will not 
require the swap. It seems that your PR has taken these into account, but it 
looks like that some places where the arguments should have been swapped have 
not been modified.

I would also recommend running tier1/tier2 to get more confidence that no test 
that should have been changed has been left over, and to make sure all tests 
that have been changed are tested.

test/jdk/java/util/BitSet/stream/BitSetStreamTest.java line 124:

> 122:         for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) 
> {
> 123:             assertTrue(it.hasNext());
> 124:             assertEquals(it.nextInt(), i);

I believe the arguments need to be swapped here: it should be 
`assertEquals(expected, actual)`

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

PR Review: https://git.openjdk.org/jdk/pull/30954#pullrequestreview-4188234260
PR Review Comment: https://git.openjdk.org/jdk/pull/30954#discussion_r3153659113

Reply via email to