New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8254692: (se) Clarify the behaviour of the non-abstract SelectorProvider::inheritedChannel #745
Conversation
|
@fguallini The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@fguallini This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 112 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@ChrisHegarty, @bplb, @AlanBateman) but any other Committer may sponsor as well.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
import static org.testng.Assert.assertThrows; | ||
|
||
/* | ||
* @test | ||
* @bug 8254692 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No disagreement about testCustomProvider not being the most appropriate place to test the default implementation of inheritedChannel. What I was suggesting was to move all the assertions related to the default implementation of SelectorProvider to a single new test located under test/jdk/java/nio/channels/spi/SelectorProvider/, rather than splitting the tests for the default implementation across several different tests and directory hierarchies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new test/jdk/java/nio/channels/spi/SelectorProvider that covers all the assertions would be great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Alan and Chris for reviewing, I moved all the assertions related to the default implementation from ProtocolFamilies to a new test class as suggested and removed unused imports in ProtocolFamilies
/csr |
@ChrisHegarty this pull request will not be integrated until the CSR request JDK-8254848 for issue JDK-8254692 has been approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new test. SelectorProvider has 3 non-abstract methods and the coverage looks good. "TestDefaultImplementation" might be a better name for the test but otherwise looks good.
Sure, TestDefaultImplementation is a bit more accurate, therefore I renamed the test accordingly in the last commit. |
/integrate |
@fguallini |
/sponsor |
@AlanBateman @fguallini Since your change was applied there have been 112 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit f813a28. |
Please review this fix to provide spec clarity on the default implementation of java.nio.channels.spi.SelectorProvider::inheritedChannel() method which simply returns “null”, and a test for it.
Please review the corresponding CSR as well: https://bugs.openjdk.java.net/browse/JDK-8254848
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/745/head:pull/745
$ git checkout pull/745