8198753: (dc) DatagramChannel throws unspecified exceptions

Alan Bateman Alan.Bateman at oracle.com
Wed Mar 21 16:50:55 UTC 2018


On 20/03/2018 19:20, Brian Burkhalter wrote:
>
> Test updates:
>
> 1. ConnectedSend reverted aside from conversion to TestNG.
> 2. ConnectExceptions and SendExceptions added to cover the newly 
> documented exceptions.
> 3. SendToUnresolved removed as this is now tested SendExceptions which 
> also includes the @bug ID from SendToUnresolved.
>
> http://cr.openjdk.java.net/~bpb/8198753/webrev.02/ 
> <http://cr.openjdk.java.net/%7Ebpb/8198753/webrev.02/>
>
The tests looks okay although personally I would use 
@Test(expectedExceptions = ..) rather than expectThrows to avoid all the 
Runnables. A variant of what you have is for the run method to throw 
IOException to avoid the the try-catch in each test.

-Alan




More information about the nio-dev mailing list