On Tue, 28 Apr 2026 08:01:45 GMT, Daisuke Yamazaki <[email protected]> wrote:

>> Hi all,
>> 
>> I have migrated these classes to JUnit:
>> - `jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java`
>> - `jdk/net/ExtendedSocketOption/DatagramChannelNAPITest.java`
>> - `jdk/net/ExtendedSocketOption/DatagramSocketNAPITest.java`
>> - `jdk/net/ExtendedSocketOption/SocketChannelNAPITest.java`
>> - `jdk/net/ExtendedSocketOption/SocketNAPITest.java`
>> 
>> The former `@BeforeTest` has been converted to a static `@BeforeAll`, as 
>> this better reflects the intended scope.
>> 
>> Additionally, I noticed an issue in the `testSocket` method where 
>> `initialRun` remained `true` for all tests (and conversely remained `false` 
>> in `SocketNAPITest`). 
>> I have corrected this so that the intended consistency check is properly 
>> exercised.
>> Please let me know if this change introduces any unintended side effects.
>> 
>> Thanks.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Daisuke Yamazaki has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Refactor NAPI tests to improve variable naming and assertion order

Generally LGTM.

test/jdk/jdk/net/ExtendedSocketOption/SocketNAPITest.java line 31:

> 29:  * @summary Check ExtendedSocketOption NAPI_ID support for Socket and
> 30:  *          ServerSocket
> 31:  * @run junit SocketNAPITest

Suggestion:

 * @run junit ${test.main.class}

test/jdk/jdk/net/ExtendedSocketOption/SocketNAPITest.java line 32:

> 30:  *          ServerSocket
> 31:  * @run junit SocketNAPITest
> 32:  * @run junit/othervm -Djava.net.preferIPv4Stack=true SocketNAPITest

Suggestion:

 * @run junit/othervm -Djava.net.preferIPv4Stack=true ${test.main.class}

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

PR Review: https://git.openjdk.org/jdk/pull/30964#pullrequestreview-4189233892
PR Review Comment: https://git.openjdk.org/jdk/pull/30964#discussion_r3154500776
PR Review Comment: https://git.openjdk.org/jdk/pull/30964#discussion_r3154504184

Reply via email to