RFR: 8254692: (se) Clarify the behaviour of the non-abstract SelectorProvider::inheritedChannel

Alan Bateman alanb at openjdk.java.net
Tue Oct 20 08:55:16 UTC 2020


On Tue, 20 Oct 2020 08:16:01 GMT, Chris Hegarty <chegar at openjdk.org> wrote:

>> test/jdk/java/nio/channels/etc/ProtocolFamilies.java line 47:
>> 
>>> 45: /*
>>> 46:  * @test
>>> 47:  * @bug 8254692
>> 
>> test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel would be a more appropriate location to test this.
>> 
>> I assume you modified etc/ProtocolFamilies.java you because it has a custom provider that doesn't override this method
>> but this test has the summary "Test SocketChannel, ServerSocketChannel and DatagramChannel with various ProtocolFamily
>> combinations" so not really the right place.
>
> The test method being changed here assets other aspects of the default implementation of `SelectorProvider` - this is
> just another case. I guess is depends on ones view, whether these checks should be co-located based on functionality or
> based on category of behaviour.  It might be best to create a new
> test/jdk/java/nio/channels/spi/SelectorProvider/DefaultImplementationTest.java to hold such, and move the other
> assertions there too.  But the higher-order bit is that we have tests.

ProtocolFamilies/testCustomProvider exercises the methods that take a protocol family, it's not really the right place
to exercise the inheritedChannel method. Can we add a test to
test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel instead?

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

PR: https://git.openjdk.java.net/jdk/pull/745


More information about the nio-dev mailing list