RFR: 8301701 : java/net/DatagramSocket/DatagramSocketMulticasting.java should be hardened

Christian Stein cstein at openjdk.org
Sat Feb 11 05:45:26 UTC 2023


On Fri, 10 Feb 2023 16:28:14 GMT, Darragh Clarke <duke at openjdk.org> wrote:

>> test/jdk/java/net/DatagramSocket/DatagramSocketMulticasting.java line 75:
>> 
>>> 73:     @Test
>>> 74:     public void main() throws IOException {
>>> 75:         IPSupport.throwSkippedExceptionIfNonOperational();
>> 
>> This can throw jtreg.SkippedException, do you know if the JUnit test runner handles this?
>
> Good point, I'll look into that

There's no special handling for such an exception type in place.

Could the "if non operational" state be passed to a call to an `Assumptions.assume...()` method instead of throwing?
- https://junit.org/junit5/docs/current/user-guide/#writing-tests-assumptions

Other alternatives are:
- https://junit.org/junit5/docs/current/user-guide/#writing-tests-conditional-execution
- https://junit.org/junit5/docs/current/user-guide/#extensions-conditions

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

PR: https://git.openjdk.org/jdk/pull/12513


More information about the net-dev mailing list