On 18/06/2021 18:30, Brian Burkhalter wrote:

On Jun 18, 2021, at 6:36 AM, Alan Bateman <al...@openjdk.java.net <mailto:al...@openjdk.java.net>> wrote:

Adding an override of transferTo may require new tests. @bplb Do you if we have good tests for all the scenarios where input stream returned by Channels.newInputStream is the source?

There are not a lot of tests for the `InputStream` returned by `Channels.newInputStream`:

 `java/nio/channels/Channels`:

`Basic.java` - reading from a wrapped `FileChannel`
`ReadByte.java` - trivial
`Basic2.java` - reading at random offsets from a wrapped `AsynchronousSocketChannel`
`ReadOffset.java` - trivial

Elsewhere:

`sun/nio/ch/TempBuffer.java`
`jdk/nio/zipfs/ZipFSTester.java`


I don’t see that `transferTo()` on such a stream is tested anywhere.

InputStream/TransferTo.java tests the default implementation. Maybe we re-structured this to use a data provider so that the tests exercise both the default implementation and the various overrides. Alternatively a new test that exercises the various overrides in different scenarios. In any case, I think the feedback for PR 4263 is that it is essentially several implementations of transferTo and each of those need to have test coverage.

-Alan

Reply via email to