#687 #691 Stream performance regressions, now with JDK 11 support...

This commit is contained in:
Harald Kuhr 2022-10-14 18:16:18 +02:00
parent 6f9b9bee01
commit c01336fb8a

View File

@ -402,18 +402,16 @@ public class BufferedChannelImageInputStreamTest {
@Test @Test
public void testCloseStream() throws IOException { public void testCloseStream() throws IOException {
// Create wrapper stream // Create wrapper stream
FileInputStream mock = mock(FileInputStream.class); FileInputStream input = spy(new FileInputStream(randomDataToFile(new byte[0])));
when(mock.getChannel()).thenCallRealMethod(); ImageInputStream stream = new BufferedChannelImageInputStream(input);
ImageInputStream stream = new BufferedChannelImageInputStream(mock); reset(input);
reset(mock);
stream.close(); stream.close();
verify(mock, only()).close(); verify(input, only()).close();
} }
@Test @Test
public void testCloseChannel() throws IOException { public void testCloseChannel() throws IOException {
// Create wrapper stream
SeekableByteChannel mock = mock(SeekableByteChannel.class); SeekableByteChannel mock = mock(SeekableByteChannel.class);
ImageInputStream stream = new BufferedChannelImageInputStream(mock); ImageInputStream stream = new BufferedChannelImageInputStream(mock);