1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.compress.archivers.dump;
20
21 import static org.junit.jupiter.api.Assertions.assertThrows;
22
23 import java.io.ByteArrayInputStream;
24 import java.io.IOException;
25
26 import org.apache.commons.compress.AbstractTest;
27 import org.junit.jupiter.params.ParameterizedTest;
28 import org.junit.jupiter.params.provider.ValueSource;
29
30 public class TapeInputStreamTest extends AbstractTest {
31 @ParameterizedTest
32 @ValueSource(ints = {-1, 0, Integer.MAX_VALUE / 1000, Integer.MAX_VALUE})
33 public void testResetBlockSizeWithInvalidValues(final int recsPerBlock) throws Exception {
34 try (TapeInputStream tapeInputStream = new TapeInputStream(new ByteArrayInputStream(new byte[1]))) {
35 assertThrows(IOException.class, () -> tapeInputStream.resetBlockSize(recsPerBlock, true));
36 }
37 }
38 }