RFR: 8334297: (so) java/nio/channels/SocketChannel/OpenLeak.java should not depend on SecurityManager [v5]

Daniel Fuchs dfuchs at openjdk.org
Mon Jun 17 18:36:53 UTC 2024


> The test java/nio/channels/SocketChannel/OpenLeak.java depends on the SecurityManager to trigger an exception in SocketChannel::connect.
> 
> This change rewrites it to connect to a TCP reserved port instead, such as port 47, 51, or 61, in order to trigger a `ConnectException` instead of a `SecurityException`.
> 
> The original issue that this test tried to check for was:
> https://bugs.openjdk.org/browse/JDK-6548464

Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:

  Refactor to ParameterizedTest. Do not test for refused connection on Windows Server 2016

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/19723/files
  - new: https://git.openjdk.org/jdk/pull/19723/files/3451a702..69fd3e37

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=19723&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=19723&range=03-04

  Stats: 88 lines in 1 file changed: 48 ins; 15 del; 25 mod
  Patch: https://git.openjdk.org/jdk/pull/19723.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19723/head:pull/19723

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


More information about the nio-dev mailing list