You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/11/03 12:59:34 UTC
(commons-compress) 02/03: Normalize test method names
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit a1e40ed1679c43b0f6444cfe669fdb39d1a008c6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 3 08:52:08 2023 -0400
Normalize test method names
---
.../apache/commons/compress/ArchiveUtilsTest.java | 6 +-
.../org/apache/commons/compress/OsgiITest.java | 4 +-
.../commons/compress/archivers/ArTestCase.java | 4 +-
.../archivers/ArchiveStreamFactoryTest.java | 12 +-
.../commons/compress/archivers/SevenZTestCase.java | 22 +--
.../commons/compress/archivers/ZipTestCase.java | 20 +--
.../archivers/ar/ArArchiveInputStreamTest.java | 10 +-
.../archivers/arj/ArjArchiveInputStreamTest.java | 4 +-
.../archivers/cpio/CpioArchiveInputStreamTest.java | 4 +-
.../compress/archivers/cpio/CpioUtilTest.java | 8 +-
.../archivers/dump/DumpArchiveEntryTest.java | 4 +-
.../archivers/dump/DumpArchiveInputStreamTest.java | 4 +-
.../archivers/dump/DumpArchiveUtilTest.java | 6 +-
.../compress/archivers/examples/ExpanderTest.java | 20 +--
.../archivers/examples/SevenZArchiverTest.java | 8 +-
.../archivers/sevenz/SevenZArchiveEntryTest.java | 22 +--
.../compress/archivers/sevenz/SevenZFileTest.java | 34 ++---
.../sevenz/SevenZMethodConfigurationTest.java | 18 +--
.../commons/compress/archivers/tar/BigFilesIT.java | 6 +-
.../compress/archivers/tar/FileTimesIT.java | 42 +++---
.../compress/archivers/tar/SparseFilesTest.java | 2 +-
.../archivers/tar/TarArchiveEntryTest.java | 26 ++--
.../archivers/tar/TarArchiveInputStreamTest.java | 30 ++--
.../compress/archivers/tar/TarFileTest.java | 30 ++--
.../archivers/tar/TarMemoryFileSystemTest.java | 2 +-
.../compress/archivers/tar/TarUtilsTest.java | 66 ++++-----
.../archivers/zip/ExtraFieldUtilsTest.java | 2 +-
.../compress/archivers/zip/NioZipEncodingTest.java | 14 +-
.../zip/ParallelScatterZipCreatorTest.java | 12 +-
.../archivers/zip/ScatterZipOutputStreamTest.java | 2 +-
.../archivers/zip/StreamCompressorTest.java | 4 +-
.../compress/archivers/zip/UTF8ZipFilesTest.java | 4 +-
.../compress/archivers/zip/X000A_NTFSTest.java | 6 +-
.../archivers/zip/X5455_ExtendedTimestampTest.java | 2 +-
.../compress/archivers/zip/Zip64SupportIT.java | 162 ++++++++++-----------
.../archivers/zip/ZipArchiveEntryTest.java | 12 +-
.../archivers/zip/ZipArchiveInputStreamTest.java | 56 +++----
.../zip/ZipFileIgnoringLocalFileHeaderTest.java | 2 +-
.../compress/archivers/zip/ZipFileTest.java | 38 ++---
.../archivers/zip/ZipMemoryFileSystemTest.java | 30 ++--
.../archivers/zip/ZipSplitOutputStreamTest.java | 2 +-
.../commons/compress/compressors/GZipTestCase.java | 4 +-
.../commons/compress/compressors/LZMATestCase.java | 6 +-
.../compress/compressors/Pack200TestCase.java | 8 +-
.../brotli/BrotliCompressorInputStreamTest.java | 10 +-
.../bzip2/BZip2CompressorInputStreamTest.java | 12 +-
.../bzip2/BZip2NSelectorsOverflowTest.java | 2 +-
.../deflate/DeflateCompressorInputStreamTest.java | 10 +-
.../deflate/DeflateCompressorOutputStreamTest.java | 2 +-
.../compressors/deflate/DeflateParametersTest.java | 6 +-
.../compressors/deflate64/Deflate64BugsTest.java | 2 +-
.../Deflate64CompressorInputStreamTest.java | 34 ++---
.../compressors/deflate64/HuffmanDecoderTest.java | 14 +-
.../lz4/BlockLZ4CompressorInputStreamTest.java | 6 +-
.../lz4/BlockLZ4CompressorOutputStreamTest.java | 36 ++---
.../compress/compressors/lz4/FactoryTest.java | 4 +-
.../lz4/FramedLZ4CompressorInputStreamTest.java | 76 +++++-----
.../AbstractLZ77CompressorInputStreamTest.java | 6 +-
.../lz77support/LZ77CompressorTest.java | 28 ++--
.../compressors/lz77support/ParametersTest.java | 28 ++--
.../FramedSnappyCompressorInputStreamTest.java | 8 +-
.../compressors/snappy/SnappyRoundtripTest.java | 10 +-
.../xz/XZCompressorInputStreamTest.java | 10 +-
.../compressors/z/ZCompressorInputStreamTest.java | 4 +-
.../zstandard/ZstdCompressorInputStreamTest.java | 8 +-
.../compressors/zstandard/ZstdRoundtripTest.java | 10 +-
.../commons/compress/utils/BitInputStreamTest.java | 16 +-
.../BoundedSeekableByteChannelInputStreamTest.java | 2 +-
.../commons/compress/utils/ByteUtilsTest.java | 36 ++---
.../commons/compress/utils/CountingStreamTest.java | 4 +-
.../commons/compress/utils/FileNameUtilsTest.java | 16 +-
.../apache/commons/compress/utils/IOUtilsTest.java | 30 ++--
.../MultiReadOnlySeekableByteChannelTest.java | 28 ++--
.../commons/compress/utils/OsgiUtilsTest.java | 2 +-
.../utils/SeekableInMemoryByteChannelTest.java | 30 ++--
.../utils/SkipShieldingInputStreamTest.java | 6 +-
.../commons/compress/utils/TimeUtilsTest.java | 6 +-
.../ZipSplitReadOnlySeekableByteChannelTest.java | 30 ++--
78 files changed, 656 insertions(+), 656 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
index 47728bae..2b1020ea 100644
--- a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
@@ -50,20 +50,20 @@ public class ArchiveUtilsTest extends AbstractTestCase {
}
@Test
- public void sanitizeLeavesShortStringsAlone() {
+ public void testSanitizeLeavesShortStringsAlone() {
final String input = "012345678901234567890123456789012345678901234567890123456789";
assertEquals(input, ArchiveUtils.sanitize(input));
}
@Test
- public void sanitizeRemovesUnprintableCharacters() {
+ public void testSanitizeRemovesUnprintableCharacters() {
final String input = "\b12345678901234567890123456789012345678901234567890123456789";
final String expected = "?12345678901234567890123456789012345678901234567890123456789";
assertEquals(expected, ArchiveUtils.sanitize(input));
}
@Test
- public void sanitizeShortensString() {
+ public void testSanitizeShortensString() {
// @formatter:off
final String input = "012345678901234567890123456789012345678901234567890123456789"
+ "012345678901234567890123456789012345678901234567890123456789"
diff --git a/src/test/java/org/apache/commons/compress/OsgiITest.java b/src/test/java/org/apache/commons/compress/OsgiITest.java
index ed2ab499..337b7a15 100644
--- a/src/test/java/org/apache/commons/compress/OsgiITest.java
+++ b/src/test/java/org/apache/commons/compress/OsgiITest.java
@@ -46,7 +46,7 @@ public class OsgiITest {
private BundleContext ctx;
@Test
- public void canLoadBundle() {
+ public void testCanLoadBundle() {
assertNotNull("Expected to find bundle " + EXPECTED_BUNDLE_NAME, loadBundle());
}
@@ -79,7 +79,7 @@ public class OsgiITest {
}
@Test
- public void properlyDetectsRunningInsideOsgiEnv() throws Exception {
+ public void testProperlyDetectsRunningInsideOsgiEnv() throws Exception {
final Class<?> osgiUtils = loadBundle().loadClass("org.apache.commons.compress.utils.OsgiUtils");
assertNotNull("Can load OsgiUtils via bundle", osgiUtils);
diff --git a/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java b/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
index 613de5f3..4d9b56f8 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
@@ -279,7 +279,7 @@ public final class ArTestCase extends AbstractTestCase {
// TODO: revisit - does AR not support storing directories?
@Disabled
@Test
- public void XtestDirectoryEntryFromFile() throws Exception {
+ public void testXtestDirectoryEntryFromFile() throws Exception {
final File[] tmp = createTempDirAndFile();
File archive = null;
archive = File.createTempFile("test.", ".ar", tmp[0]);
@@ -312,7 +312,7 @@ public final class ArTestCase extends AbstractTestCase {
// TODO: revisit - does AR not support storing directories?
@Disabled
@Test
- public void XtestExplicitDirectoryEntry() throws Exception {
+ public void testXtestExplicitDirectoryEntry() throws Exception {
final File[] tmp = createTempDirAndFile();
File archive = null;
archive = File.createTempFile("test.", ".ar", tmp[0]);
diff --git a/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java b/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
index 6e4c344d..79da242c 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ArchiveStreamFactoryTest.java
@@ -201,7 +201,7 @@ public class ArchiveStreamFactoryTest extends AbstractTestCase {
* see https://issues.apache.org/jira/browse/COMPRESS-191
*/
@Test
- public void aiffFilesAreNoTARs() throws Exception {
+ public void testAiffFilesAreNoTARs() throws Exception {
try (final InputStream fis = newInputStream("testAIFF.aif");
final InputStream is = new BufferedInputStream(fis)) {
final ArchiveException ae = assertThrows(ArchiveException.class, () -> ArchiveStreamFactory.DEFAULT.createArchiveInputStream(is),
@@ -211,12 +211,12 @@ public class ArchiveStreamFactoryTest extends AbstractTestCase {
}
@Test
- public void cantRead7zFromStream() throws Exception {
+ public void testCantRead7zFromStream() throws Exception {
assertThrows(StreamingNotSupportedException.class,
() -> ArchiveStreamFactory.DEFAULT.createArchiveInputStream(ArchiveStreamFactory.SEVEN_Z, new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY)));
}
@Test
- public void cantWrite7zToStream() throws Exception {
+ public void testCantWrite7zToStream() throws Exception {
assertThrows(StreamingNotSupportedException.class,
() -> ArchiveStreamFactory.DEFAULT.createArchiveOutputStream(ArchiveStreamFactory.SEVEN_Z, new ByteArrayOutputStream()));
}
@@ -232,7 +232,7 @@ public class ArchiveStreamFactoryTest extends AbstractTestCase {
* >COMPRESS-267</a>.
*/
@Test
- public void detectsAndThrowsFor7z() throws Exception {
+ public void testDetectsAndThrowsFor7z() throws Exception {
try (final InputStream fis = newInputStream("bla.7z");
final InputStream bis = new BufferedInputStream(fis)) {
final StreamingNotSupportedException ex = assertThrows(StreamingNotSupportedException.class, () -> ArchiveStreamFactory.DEFAULT.createArchiveInputStream(bis),
@@ -262,7 +262,7 @@ public class ArchiveStreamFactoryTest extends AbstractTestCase {
* see https://issues.apache.org/jira/browse/COMPRESS-171
*/
@Test
- public void shortTextFilesAreNoTARs() {
+ public void testShortTextFilesAreNoTARs() {
final ArchiveException ae = assertThrows(ArchiveException.class, () -> ArchiveStreamFactory.DEFAULT.createArchiveInputStream(
new ByteArrayInputStream("This certainly is not a tar archive, really, no kidding".getBytes())), "created an input stream for a non-archive");
assertTrue(ae.getMessage().startsWith("No Archiver found"));
@@ -274,7 +274,7 @@ public class ArchiveStreamFactoryTest extends AbstractTestCase {
* >COMPRESS-208</a>.
*/
@Test
- public void skipsPK00Prefix() throws Exception {
+ public void testSkipsPK00Prefix() throws Exception {
try (InputStream fis = newInputStream("COMPRESS-208.zip")) {
try (InputStream bis = new BufferedInputStream(fis)) {
try (ArchiveInputStream<?> ais = ArchiveStreamFactory.DEFAULT.createArchiveInputStream(bis)) {
diff --git a/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java b/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java
index 4e95ec9b..0aa99f5e 100644
--- a/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java
+++ b/src/test/java/org/apache/commons/compress/archivers/SevenZTestCase.java
@@ -97,7 +97,7 @@ public class SevenZTestCase extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingAES() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingAES() throws Exception {
assumeStrongCryptoIsAvailable();
try (SevenZFile archive = new SevenZFile(getFile("bla.encrypted.7z"), "foo".toCharArray())) {
multiByteReadConsistentlyReturnsMinusOneAtEof(archive);
@@ -105,22 +105,22 @@ public class SevenZTestCase extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingBZIP2() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingBZIP2() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.BZIP2);
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.DEFLATE);
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.LZMA);
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA2() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA2() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.LZMA2);
}
@@ -155,7 +155,7 @@ public class SevenZTestCase extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingAES() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingAES() throws Exception {
assumeStrongCryptoIsAvailable();
try (SevenZFile archive = new SevenZFile(getFile("bla.encrypted.7z"), "foo".toCharArray())) {
singleByteReadConsistentlyReturnsMinusOneAtEof(archive);
@@ -163,27 +163,27 @@ public class SevenZTestCase extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingBZIP2() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingBZIP2() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.BZIP2);
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingCopy() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingCopy() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.COPY);
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.DEFLATE);
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.LZMA);
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA2() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingLZMA2() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(SevenZMethod.LZMA2);
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java b/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
index a9e4f3d0..09551287 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
@@ -121,7 +121,7 @@ public final class ZipTestCase extends AbstractTestCase {
}
@Test
- public void buildSplitZipTest() throws IOException {
+ public void testBuildSplitZipTest() throws IOException {
final File directoryToZip = getFilesToZip();
createTestSplitZipSegments();
@@ -152,7 +152,7 @@ public final class ZipTestCase extends AbstractTestCase {
}
@Test
- public void buildSplitZipWithSegmentAlreadyExistThrowsException() throws IOException {
+ public void testBuildSplitZipWithSegmentAlreadyExistThrowsException() throws IOException {
final File directoryToZip = getFilesToZip();
final File outputZipFile = new File(dir, "splitZip.zip");
final long splitSize = 100 * 1024L; /* 100 KB */
@@ -174,7 +174,7 @@ public final class ZipTestCase extends AbstractTestCase {
}
@Test
- public void buildSplitZipWithTooLargeSizeThrowsException() throws IOException {
+ public void testBuildSplitZipWithTooLargeSizeThrowsException() throws IOException {
final Path file = Files.createTempFile("temp", "zip");
try {
assertThrows(IllegalArgumentException.class, () -> new ZipArchiveOutputStream(file, 4294967295L + 1));
@@ -184,7 +184,7 @@ public final class ZipTestCase extends AbstractTestCase {
}
@Test
- public void buildSplitZipWithTooSmallSizeThrowsException() throws IOException {
+ public void testBuildSplitZipWithTooSmallSizeThrowsException() throws IOException {
final Path file = Files.createTempFile("temp", "zip");
try {
assertThrows(IllegalArgumentException.class, () -> new ZipArchiveOutputStream(File.createTempFile("temp", "zip"), 64 * 1024 - 1));
@@ -280,14 +280,14 @@ public final class ZipTestCase extends AbstractTestCase {
}
@Test
- public void inputStreamStatisticsForBzip2Entry() throws IOException, ArchiveException {
+ public void testInputStreamStatisticsForBzip2Entry() throws IOException, ArchiveException {
final Map<String, List<Long>> expected = new HashMap<>();
expected.put("lots-of-as", Arrays.asList(42L, 39L));
testInputStreamStatistics("bzip2-zip.zip", expected);
}
@Test
- public void inputStreamStatisticsForDeflate64Entry() throws IOException, ArchiveException {
+ public void testInputStreamStatisticsForDeflate64Entry() throws IOException, ArchiveException {
final Map<String, List<Long>> expected = new HashMap<>();
expected.put("input2", Arrays.asList(3072L, 2111L));
testInputStreamStatistics("COMPRESS-380/COMPRESS-380.zip", expected);
@@ -295,14 +295,14 @@ public final class ZipTestCase extends AbstractTestCase {
@Test
- public void inputStreamStatisticsForImplodedEntry() throws IOException, ArchiveException {
+ public void testInputStreamStatisticsForImplodedEntry() throws IOException, ArchiveException {
final Map<String, List<Long>> expected = new HashMap<>();
expected.put("LICENSE.TXT", Arrays.asList(11560L, 4131L));
testInputStreamStatistics("imploding-8Kdict-3trees.zip", expected);
}
@Test
- public void inputStreamStatisticsForShrunkEntry() throws IOException, ArchiveException {
+ public void testInputStreamStatisticsForShrunkEntry() throws IOException, ArchiveException {
final Map<String, List<Long>> expected = new HashMap<>();
expected.put("TEST1.XML", Arrays.asList(76L, 66L));
expected.put("TEST2.XML", Arrays.asList(81L, 76L));
@@ -310,14 +310,14 @@ public final class ZipTestCase extends AbstractTestCase {
}
@Test
- public void inputStreamStatisticsForStoredEntry() throws IOException, ArchiveException {
+ public void testInputStreamStatisticsForStoredEntry() throws IOException, ArchiveException {
final Map<String, List<Long>> expected = new HashMap<>();
expected.put("test.txt", Arrays.asList(5L, 5L));
testInputStreamStatistics("COMPRESS-264.zip", expected);
}
@Test
- public void inputStreamStatisticsOfZipBombExcel() throws IOException, ArchiveException {
+ public void testInputStreamStatisticsOfZipBombExcel() throws IOException, ArchiveException {
final Map<String, List<Long>> expected = new HashMap<>();
expected.put("[Content_Types].xml", Arrays.asList(8390036L, 8600L));
expected.put("xl/worksheets/sheet1.xml", Arrays.asList(1348L, 508L));
diff --git a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
index 667d277b..17639c98 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
public class ArArchiveInputStreamTest extends AbstractTestCase {
@Test
- public void cantReadAfterClose() throws Exception {
+ public void testCantReadAfterClose() throws Exception {
try (InputStream in = newInputStream("bla.ar");
ArArchiveInputStream archive = new ArArchiveInputStream(in)) {
archive.close();
@@ -47,7 +47,7 @@ public class ArArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void cantReadWithoutOpeningAnEntry() throws Exception {
+ public void testCantReadWithoutOpeningAnEntry() throws Exception {
try (InputStream in = newInputStream("bla.ar");
ArArchiveInputStream archive = new ArArchiveInputStream(in)) {
assertThrows(IllegalStateException.class, () -> archive.read());
@@ -74,7 +74,7 @@ public class ArArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (InputStream in = newInputStream("bla.ar");
ArArchiveInputStream archive = new ArArchiveInputStream(in)) {
@@ -86,7 +86,7 @@ public class ArArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void simpleInputStream() throws IOException {
+ public void testSimpleInputStream() throws IOException {
try (final InputStream fileInputStream = newInputStream("bla.ar")) {
// This default implementation of InputStream.available() always returns zero,
@@ -115,7 +115,7 @@ public class ArArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (InputStream in = newInputStream("bla.ar");
ArArchiveInputStream archive = new ArArchiveInputStream(in)) {
final ArchiveEntry e = archive.getNextEntry();
diff --git a/src/test/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStreamTest.java
index 39be43f2..9710116c 100644
--- a/src/test/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/arj/ArjArchiveInputStreamTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
public class ArjArchiveInputStreamTest extends AbstractTestCase {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (InputStream in = newInputStream("bla.arj");
ArjArchiveInputStream archive = new ArjArchiveInputStream(in)) {
@@ -46,7 +46,7 @@ public class ArjArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (InputStream in = newInputStream("bla.arj");
ArjArchiveInputStream archive = new ArjArchiveInputStream(in)) {
final ArchiveEntry e = archive.getNextEntry();
diff --git a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStreamTest.java
index 1a286fdf..c20b2c87 100644
--- a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStreamTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
public class CpioArchiveInputStreamTest extends AbstractTestCase {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (InputStream in = newInputStream("bla.cpio"); CpioArchiveInputStream archive = new CpioArchiveInputStream(in)) {
final ArchiveEntry e = archive.getNextEntry();
@@ -42,7 +42,7 @@ public class CpioArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (InputStream in = newInputStream("bla.cpio"); CpioArchiveInputStream archive = new CpioArchiveInputStream(in)) {
final ArchiveEntry e = archive.getNextEntry();
IOUtils.toByteArray(archive);
diff --git a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
index ff59a420..a93c0fb3 100644
--- a/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/cpio/CpioUtilTest.java
@@ -27,22 +27,22 @@ import org.junit.jupiter.api.Test;
public class CpioUtilTest {
@Test
- public void oldBinMagic2ByteArrayNotSwapped() {
+ public void testOldBinMagic2ByteArrayNotSwapped() {
assertArrayEquals(new byte[] {(byte) 0xc7, 0x71}, CpioUtil.long2byteArray(CpioConstants.MAGIC_OLD_BINARY, 2, false));
}
@Test
- public void oldBinMagic2ByteArraySwapped() {
+ public void testOldBinMagic2ByteArraySwapped() {
assertArrayEquals(new byte[] {0x71, (byte) 0xc7,}, CpioUtil.long2byteArray(CpioConstants.MAGIC_OLD_BINARY, 2, true));
}
@Test
- public void oldBinMagicFromByteArrayNotSwapped() {
+ public void testOldBinMagicFromByteArrayNotSwapped() {
assertEquals(CpioConstants.MAGIC_OLD_BINARY, CpioUtil.byteArray2long(new byte[] {(byte) 0xc7, 0x71}, false));
}
@Test
- public void oldBinMagicFromByteArraySwapped() {
+ public void testOldBinMagicFromByteArraySwapped() {
assertEquals(CpioConstants.MAGIC_OLD_BINARY, CpioUtil.byteArray2long(new byte[] {0x71, (byte) 0xc7}, true));
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java b/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java
index 6156a409..5406a3ed 100644
--- a/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntryTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
public class DumpArchiveEntryTest {
@Test
- public void publicNameAddsTrailingSlashForDirectories() {
+ public void testPublicNameAddsTrailingSlashForDirectories() {
final DumpArchiveEntry ent = new DumpArchiveEntry("foo", "bar", -1,
DumpArchiveEntry.TYPE
.DIRECTORY);
@@ -34,7 +34,7 @@ public class DumpArchiveEntryTest {
}
@Test
- public void publicNameRemovesLeadingDotSlash() {
+ public void testPublicNameRemovesLeadingDotSlash() {
final DumpArchiveEntry ent = new DumpArchiveEntry("./foo", "bar");
assertEquals("bar", ent.getSimpleName());
assertEquals("./foo", ent.getOriginalName());
diff --git a/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStreamTest.java
index 8d9bbb41..0c46a2b5 100644
--- a/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStreamTest.java
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
public class DumpArchiveInputStreamTest extends AbstractTestCase {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (InputStream in = newInputStream("bla.dump");
DumpArchiveInputStream archive = new DumpArchiveInputStream(in)) {
@@ -47,7 +47,7 @@ public class DumpArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (InputStream in = newInputStream("bla.dump");
DumpArchiveInputStream archive = new DumpArchiveInputStream(in)) {
final ArchiveEntry e = archive.getNextEntry();
diff --git a/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java b/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java
index 9b90a805..89a3ad64 100644
--- a/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtilTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
public class DumpArchiveUtilTest {
@Test
- public void convert16() {
+ public void testConvert16() {
assertEquals(0xABCD,
DumpArchiveUtil.convert16(new byte[] {
(byte) 0xCD, (byte) 0xAB
@@ -33,7 +33,7 @@ public class DumpArchiveUtilTest {
}
@Test
- public void convert32() {
+ public void testConvert32() {
assertEquals(0xABCDEF01,
DumpArchiveUtil.convert32(new byte[] {
1, (byte) 0xEF, (byte) 0xCD, (byte) 0xAB
@@ -41,7 +41,7 @@ public class DumpArchiveUtilTest {
}
@Test
- public void convert64() {
+ public void testConvert64() {
assertEquals(0xABCDEF0123456780L,
DumpArchiveUtil.convert64(new byte[] {
(byte) 0x80, 0x67, 0x45, 0x23, 1, (byte) 0xEF,
diff --git a/src/test/java/org/apache/commons/compress/archivers/examples/ExpanderTest.java b/src/test/java/org/apache/commons/compress/archivers/examples/ExpanderTest.java
index 4d73ade2..52bd8da5 100644
--- a/src/test/java/org/apache/commons/compress/archivers/examples/ExpanderTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/examples/ExpanderTest.java
@@ -63,7 +63,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void fileCantEscapeDoubleDotPath() throws IOException, ArchiveException {
+ public void testFileCantEscapeDoubleDotPath() throws IOException, ArchiveException {
setupZip("../foo");
try (ZipFile f = new ZipFile(archive)) {
assertThrows(IOException.class, () -> new Expander().expand(f, resultDir));
@@ -71,7 +71,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void fileCantEscapeDoubleDotPathWithSimilarSibling() throws IOException, ArchiveException {
+ public void testFileCantEscapeDoubleDotPathWithSimilarSibling() throws IOException, ArchiveException {
final String sibling = resultDir.getName() + "x";
final File s = new File(resultDir.getParentFile(), sibling);
assumeFalse(s.exists());
@@ -89,7 +89,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void fileCantEscapeViaAbsolutePath() throws IOException, ArchiveException {
+ public void testFileCantEscapeViaAbsolutePath() throws IOException, ArchiveException {
setupZip("/tmp/foo");
try (ZipFile f = new ZipFile(archive)) {
assertThrows(IOException.class, () -> new Expander().expand(f, resultDir));
@@ -210,7 +210,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void sevenZChannelVersion() throws IOException, ArchiveException {
+ public void testSevenZChannelVersion() throws IOException, ArchiveException {
setup7z();
try (SeekableByteChannel c = FileChannel.open(archive.toPath(), StandardOpenOption.READ)) {
new Expander().expand("7z", c, resultDir);
@@ -219,7 +219,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void sevenZFileVersion() throws IOException {
+ public void testSevenZFileVersion() throws IOException {
setup7z();
try (SevenZFile f = new SevenZFile(archive)) {
new Expander().expand(f, resultDir);
@@ -228,7 +228,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void sevenZInputStreamVersion() throws IOException {
+ public void testSevenZInputStreamVersion() throws IOException {
setup7z();
try (InputStream i = new BufferedInputStream(Files.newInputStream(archive.toPath()))) {
assertThrows(StreamingNotSupportedException.class, () -> new Expander().expand("7z", i, resultDir));
@@ -236,7 +236,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void sevenZInputStreamVersionWithAutoDetection() throws IOException {
+ public void testSevenZInputStreamVersionWithAutoDetection() throws IOException {
setup7z();
try (InputStream i = new BufferedInputStream(Files.newInputStream(archive.toPath()))) {
assertThrows(StreamingNotSupportedException.class, () -> new Expander().expand(i, resultDir));
@@ -244,14 +244,14 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void sevenZTwoFileVersion() throws IOException, ArchiveException {
+ public void testSevenZTwoFileVersion() throws IOException, ArchiveException {
setup7z();
new Expander().expand("7z", archive, resultDir);
verifyTargetDir();
}
@Test
- public void sevenZTwoFileVersionWithAutoDetection() throws IOException, ArchiveException {
+ public void testSevenZTwoFileVersionWithAutoDetection() throws IOException, ArchiveException {
setup7z();
new Expander().expand(archive, resultDir);
verifyTargetDir();
@@ -284,7 +284,7 @@ public class ExpanderTest extends AbstractTestCase {
}
@Test
- public void zipFileVersion() throws IOException, ArchiveException {
+ public void testZipFileVersion() throws IOException, ArchiveException {
setupZip();
try (ZipFile f = new ZipFile(archive)) {
new Expander().expand(f, resultDir);
diff --git a/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java b/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java
index 41cfbd89..40e6e9cd 100644
--- a/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/examples/SevenZArchiverTest.java
@@ -64,7 +64,7 @@ public class SevenZArchiverTest extends AbstractTestCase {
}
@Test
- public void channelVersion() throws IOException, ArchiveException {
+ public void testChannelVersion() throws IOException, ArchiveException {
try (SeekableByteChannel c = FileChannel.open(target.toPath(), StandardOpenOption.WRITE,
StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) {
new Archiver().create("7z", c, dir);
@@ -73,13 +73,13 @@ public class SevenZArchiverTest extends AbstractTestCase {
}
@Test
- public void fileVersion() throws IOException, ArchiveException {
+ public void testFileVersion() throws IOException, ArchiveException {
new Archiver().create("7z", target, dir);
verifyContent();
}
@Test
- public void outputStreamVersion() throws IOException {
+ public void testOutputStreamVersion() throws IOException {
try (OutputStream os = Files.newOutputStream(target.toPath())) {
assertThrows(StreamingNotSupportedException.class, () -> new Archiver().create("7z", os, dir));
}
@@ -102,7 +102,7 @@ public class SevenZArchiverTest extends AbstractTestCase {
// not really a 7z test, but I didn't feel like adding a new test just for this
@Test
- public void unknownFormat() throws IOException {
+ public void testUnknownFormat() throws IOException {
try (SeekableByteChannel c = FileChannel.open(target.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING)) {
assertThrows(ArchiveException.class, () -> new Archiver().create("unknown format", c, dir));
diff --git a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntryTest.java b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntryTest.java
index f069d11e..25817684 100644
--- a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntryTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZArchiveEntryTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
public class SevenZArchiveEntryTest {
@Test
- public void methodConfigurationMattersInEquals() {
+ public void testMethodConfigurationMattersInEquals() {
final SevenZArchiveEntry z1 = new SevenZArchiveEntry();
final SevenZArchiveEntry z2 = new SevenZArchiveEntry();
final SevenZArchiveEntry z3 = new SevenZArchiveEntry();
@@ -42,7 +42,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void methodOrderMattersInEquals() {
+ public void testMethodOrderMattersInEquals() {
final SevenZArchiveEntry z1 = new SevenZArchiveEntry();
final SevenZArchiveEntry z2 = new SevenZArchiveEntry();
z1.setContentMethods(new SevenZMethodConfiguration(SevenZMethod.LZMA2), new SevenZMethodConfiguration(SevenZMethod.DELTA_FILTER));
@@ -52,7 +52,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void noMethodsIsDifferentFromSomeMethods() {
+ public void testNoMethodsIsDifferentFromSomeMethods() {
final SevenZArchiveEntry z1 = new SevenZArchiveEntry();
final SevenZArchiveEntry z2 = new SevenZArchiveEntry();
z2.setContentMethods(new SevenZMethodConfiguration(SevenZMethod.COPY));
@@ -61,7 +61,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void oneMethodsIsDifferentFromTwoMethods() {
+ public void testOneMethodsIsDifferentFromTwoMethods() {
final SevenZArchiveEntry z1 = new SevenZArchiveEntry();
final SevenZArchiveEntry z2 = new SevenZArchiveEntry();
z1.setContentMethods(new SevenZMethodConfiguration(SevenZMethod.COPY));
@@ -71,7 +71,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void sameMethodsYieldEqualEntries() {
+ public void testSameMethodsYieldEqualEntries() {
final SevenZArchiveEntry z1 = new SevenZArchiveEntry();
final SevenZArchiveEntry z2 = new SevenZArchiveEntry();
z1.setContentMethods(new SevenZMethodConfiguration(SevenZMethod.DELTA_FILTER), new SevenZMethodConfiguration(SevenZMethod.LZMA2));
@@ -81,7 +81,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void shouldThrowIfAccessDateIsSetToNull() {
+ public void testShouldThrowIfAccessDateIsSetToNull() {
assertThrows(UnsupportedOperationException.class, () -> {
final SevenZArchiveEntry entry = new SevenZArchiveEntry();
entry.setAccessDate(null);
@@ -90,7 +90,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void shouldThrowIfCreationDateIsSetToNull() {
+ public void testShouldThrowIfCreationDateIsSetToNull() {
assertThrows(UnsupportedOperationException.class, () -> {
final SevenZArchiveEntry entry = new SevenZArchiveEntry();
entry.setCreationDate(null);
@@ -99,7 +99,7 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void shouldThrowIfLastModifiedDateIsSetToNull() {
+ public void testShouldThrowIfLastModifiedDateIsSetToNull() {
assertThrows(UnsupportedOperationException.class, () -> {
final SevenZArchiveEntry entry = new SevenZArchiveEntry();
entry.setLastModifiedDate(null);
@@ -108,17 +108,17 @@ public class SevenZArchiveEntryTest {
}
@Test
- public void shouldThrowIfNoAccessDateIsSet() {
+ public void testShouldThrowIfNoAccessDateIsSet() {
assertThrows(UnsupportedOperationException.class, () -> new SevenZArchiveEntry().getAccessDate());
}
@Test
- public void shouldThrowIfNoCreationDateIsSet() {
+ public void testShouldThrowIfNoCreationDateIsSet() {
assertThrows(UnsupportedOperationException.class, () -> new SevenZArchiveEntry().getCreationDate());
}
@Test
- public void shouldThrowIfNoLastModifiedDateIsSet() {
+ public void testShouldThrowIfNoLastModifiedDateIsSet() {
assertThrows(UnsupportedOperationException.class, () -> new SevenZArchiveEntry().getLastModifiedDate());
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
index 5747470c..5cee9c96 100644
--- a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZFileTest.java
@@ -107,7 +107,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void extractNonExistSpecifiedFile() throws Exception {
+ public void testExtractNonExistSpecifiedFile() throws Exception {
try (SevenZFile sevenZFile = new SevenZFile(getFile("COMPRESS-256.7z")); SevenZFile anotherSevenZFile = new SevenZFile(getFile("bla.7z"))) {
for (final SevenZArchiveEntry nonExistEntry : anotherSevenZFile.getEntries()) {
assertThrows(IllegalArgumentException.class, () -> sevenZFile.getInputStream(nonExistEntry));
@@ -116,7 +116,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void extractSpecifiedFile() throws Exception {
+ public void testExtractSpecifiedFile() throws Exception {
try (SevenZFile sevenZFile = new SevenZFile(getFile("COMPRESS-256.7z"))) {
final String testTxtContents = "111111111111111111111111111000101011\n" +
"111111111111111111111111111000101011\n" +
@@ -147,7 +147,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void getDefaultNameWorksAsExpected() throws Exception {
+ public void testGetDefaultNameWorksAsExpected() throws Exception {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla.deflate64.7z"))) {
assertEquals("bla.deflate64", sevenZFile.getDefaultName());
}
@@ -163,7 +163,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void getEntriesOfUnarchiveInMemoryTest() throws IOException {
+ public void testGetEntriesOfUnarchiveInMemoryTest() throws IOException {
final byte[] data = Files.readAllBytes(getFile("bla.7z").toPath());
try (SevenZFile sevenZFile = new SevenZFile(new SeekableInMemoryByteChannel(data))) {
final Iterable<SevenZArchiveEntry> entries = sevenZFile.getEntries();
@@ -177,7 +177,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void getEntriesOfUnarchiveTest() throws IOException {
+ public void testGetEntriesOfUnarchiveTest() throws IOException {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla.7z"))) {
final Iterable<SevenZArchiveEntry> entries = sevenZFile.getEntries();
final Iterator<SevenZArchiveEntry> iter = entries.iterator();
@@ -190,7 +190,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void givenNameWinsOverDefaultName() throws Exception {
+ public void testGivenNameWinsOverDefaultName() throws Exception {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla.7z"),
SevenZFileOptions.builder().withUseDefaultNameForUnnamedEntries(true).build())) {
SevenZArchiveEntry ae = sevenZFile.getNextEntry();
@@ -207,7 +207,7 @@ public class SevenZFileTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-492">COMPRESS-492</a>
*/
@Test
- public void handlesEmptyArchiveWithFilesInfo() throws Exception {
+ public void testHandlesEmptyArchiveWithFilesInfo() throws Exception {
final File f = new File(dir, "empty.7z");
try (SevenZOutputFile s = new SevenZOutputFile(f)) {
}
@@ -221,7 +221,7 @@ public class SevenZFileTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-492">COMPRESS-492</a>
*/
@Test
- public void handlesEmptyArchiveWithoutFilesInfo() throws Exception {
+ public void testHandlesEmptyArchiveWithoutFilesInfo() throws Exception {
try (SevenZFile z = new SevenZFile(getFile("COMPRESS-492.7z"))) {
assertFalse(z.getEntries().iterator().hasNext());
assertNull(z.getNextEntry());
@@ -229,7 +229,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void limitExtractionMemory() {
+ public void testLimitExtractionMemory() {
assertThrows(MemoryLimitException.class, () -> {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla.7z"), SevenZFileOptions.builder().withMaxMemoryLimitInKb(1).build())) {
// Do nothing. Exception should be thrown
@@ -238,7 +238,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void noNameCanBeReplacedByDefaultName() throws Exception {
+ public void testNoNameCanBeReplacedByDefaultName() throws Exception {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla-nonames.7z"),
SevenZFileOptions.builder().withUseDefaultNameForUnnamedEntries(true).build())) {
SevenZArchiveEntry ae = sevenZFile.getNextEntry();
@@ -252,7 +252,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void noNameMeansNoNameByDefault() throws Exception {
+ public void testNoNameMeansNoNameByDefault() throws Exception {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla-nonames.7z"))) {
SevenZArchiveEntry ae = sevenZFile.getNextEntry();
assertNotNull(ae);
@@ -265,7 +265,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void readBigSevenZipFile() throws IOException {
+ public void testReadBigSevenZipFile() throws IOException {
try (SevenZFile sevenZFile = new SevenZFile(getFile("COMPRESS-592.7z"))) {
SevenZArchiveEntry entry = sevenZFile.getNextEntry();
while (entry != null) {
@@ -282,7 +282,7 @@ public class SevenZFileTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-348"
*/
@Test
- public void readEntriesOfSize0() throws IOException {
+ public void testReadEntriesOfSize0() throws IOException {
try (SevenZFile sevenZFile = new SevenZFile(getFile("COMPRESS-348.7z"))) {
int entries = 0;
SevenZArchiveEntry entry = sevenZFile.getNextEntry();
@@ -310,7 +310,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void readTimesFromFile() throws IOException {
+ public void testReadTimesFromFile() throws IOException {
try (SevenZFile sevenZFile = new SevenZFile(getFile("times.7z"))) {
SevenZArchiveEntry entry = sevenZFile.getNextEntry();
assertNotNull(entry);
@@ -336,7 +336,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void retrieveInputStreamForAllEntriesMultipleTimes() throws IOException {
+ public void testRetrieveInputStreamForAllEntriesMultipleTimes() throws IOException {
try (SevenZFile sevenZFile = new SevenZFile(getFile("bla.7z"))) {
for (final SevenZArchiveEntry entry : sevenZFile.getEntries()) {
final byte[] firstRead = IOUtils.toByteArray(sevenZFile.getInputStream(entry));
@@ -347,7 +347,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void retrieveInputStreamForAllEntriesWithoutCRCMultipleTimes() throws IOException {
+ public void testRetrieveInputStreamForAllEntriesWithoutCRCMultipleTimes() throws IOException {
try (final SevenZOutputFile out = new SevenZOutputFile(new File(dir, "test.7z"))) {
final Path inputFile = Files.createTempFile("SevenZTestTemp", "");
@@ -369,7 +369,7 @@ public class SevenZFileTest extends AbstractTestCase {
}
@Test
- public void retrieveInputStreamForShuffledEntries() throws IOException {
+ public void testRetrieveInputStreamForShuffledEntries() throws IOException {
try (final SevenZFile sevenZFile = new SevenZFile(getFile("COMPRESS-348.7z"))) {
final List<SevenZArchiveEntry> entries = (List<SevenZArchiveEntry>) sevenZFile.getEntries();
Collections.shuffle(entries);
diff --git a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZMethodConfigurationTest.java b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZMethodConfigurationTest.java
index fc7a3093..5d641831 100644
--- a/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZMethodConfigurationTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/sevenz/SevenZMethodConfigurationTest.java
@@ -26,47 +26,47 @@ import org.tukaani.xz.LZMA2Options;
public class SevenZMethodConfigurationTest {
@Test
- public void shouldAllowLZMA2OptionsForLZMA() {
+ public void testShouldAllowLZMA2OptionsForLZMA() {
assertNotNull(new SevenZMethodConfiguration(SevenZMethod.LZMA, new LZMA2Options()).getOptions());
}
@Test
- public void shouldAllowLZMA2OptionsForLZMA2() {
+ public void testShouldAllowLZMA2OptionsForLZMA2() {
assertNotNull(new SevenZMethodConfiguration(SevenZMethod.LZMA2, new LZMA2Options()).getOptions());
}
@Test
- public void shouldAllowNullOptions() {
+ public void testShouldAllowNullOptions() {
assertNull(new SevenZMethodConfiguration(SevenZMethod.LZMA2, null).getOptions());
}
@Test
- public void shouldAllowNumberForBzip2() {
+ public void testShouldAllowNumberForBzip2() {
assertNotNull(new SevenZMethodConfiguration(SevenZMethod.BZIP2, 42).getOptions());
}
@Test
- public void shouldAllowNumberForDeflate() {
+ public void testShouldAllowNumberForDeflate() {
assertNotNull(new SevenZMethodConfiguration(SevenZMethod.DEFLATE, 42).getOptions());
}
@Test
- public void shouldAllowNumberForLZMA() {
+ public void testShouldAllowNumberForLZMA() {
assertNotNull(new SevenZMethodConfiguration(SevenZMethod.LZMA, 42).getOptions());
}
@Test
- public void shouldAllowNumberForLZMA2() {
+ public void testShouldAllowNumberForLZMA2() {
assertNotNull(new SevenZMethodConfiguration(SevenZMethod.LZMA2, 42).getOptions());
}
@Test
- public void shouldNotAllowStringOptionsForLZMA() {
+ public void testShouldNotAllowStringOptionsForLZMA() {
assertThrows(IllegalArgumentException.class, () -> new SevenZMethodConfiguration(SevenZMethod.LZMA, ""));
}
@Test
- public void shouldNotAllowStringOptionsForLZMA2() {
+ public void testShouldNotAllowStringOptionsForLZMA2() {
assertThrows(IllegalArgumentException.class, () -> new SevenZMethodConfiguration(SevenZMethod.LZMA2, ""));
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java b/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java
index 3563807f..3be814aa 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/BigFilesIT.java
@@ -62,17 +62,17 @@ public class BigFilesIT extends AbstractTestCase {
}
@Test
- public void readFileBiggerThan8GBytePosix() throws Exception {
+ public void testReadFileBiggerThan8GBytePosix() throws Exception {
readFileBiggerThan8GByte("8.posix.tar.gz");
}
@Test
- public void readFileBiggerThan8GByteStar() throws Exception {
+ public void testReadFileBiggerThan8GByteStar() throws Exception {
readFileBiggerThan8GByte("8.star.tar.gz");
}
@Test
- public void readFileHeadersOfArchiveBiggerThan8GByte() throws Exception {
+ public void testReadFileHeadersOfArchiveBiggerThan8GByte() throws Exception {
try (InputStream in = new BufferedInputStream(Files.newInputStream(getPath("8.posix.tar.gz")));
GzipCompressorInputStream gzin = new GzipCompressorInputStream(in);
TarArchiveInputStream tin = new TarArchiveInputStream(gzin)) {
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/FileTimesIT.java b/src/test/java/org/apache/commons/compress/archivers/tar/FileTimesIT.java
index da712200..7cbdbe3a 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/FileTimesIT.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/FileTimesIT.java
@@ -45,7 +45,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended POSIX.1-2001 standard tar + x-header
// Created using s-tar 1.6
@Test
- public void readTimeFromTarEpax() throws Exception {
+ public void testReadTimeFromTarEpax() throws Exception {
final String file = "COMPRESS-612/test-times-epax-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -75,7 +75,7 @@ public class FileTimesIT extends AbstractTestCase {
// 'xustar' format - always x-header
@Test
- public void readTimeFromTarExustar() throws Exception {
+ public void testReadTimeFromTarExustar() throws Exception {
final String file = "COMPRESS-612/test-times-exustar-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -105,7 +105,7 @@ public class FileTimesIT extends AbstractTestCase {
// GNU tar format 1989 (violates POSIX)
// Created using GNU tar
@Test
- public void readTimeFromTarGnu() throws Exception {
+ public void testReadTimeFromTarGnu() throws Exception {
final String file = "COMPRESS-612/test-times-gnu.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -123,7 +123,7 @@ public class FileTimesIT extends AbstractTestCase {
// GNU tar format 1989 (violates POSIX)
// Created using GNU tar
@Test
- public void readTimeFromTarGnuIncremental() throws Exception {
+ public void testReadTimeFromTarGnuIncremental() throws Exception {
final String file = "COMPRESS-612/test-times-gnu-incremental.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -150,7 +150,7 @@ public class FileTimesIT extends AbstractTestCase {
// GNU tar format 1989 (violates POSIX)
// Created using s-tar 1.6, which somehow differs from GNU tar's.
@Test
- public void readTimeFromTarGnuTar() throws Exception {
+ public void testReadTimeFromTarGnuTar() throws Exception {
final String file = "COMPRESS-612/test-times-gnutar.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -167,7 +167,7 @@ public class FileTimesIT extends AbstractTestCase {
// Old BSD tar format
@Test
- public void readTimeFromTarOldBsdTar() throws Exception {
+ public void testReadTimeFromTarOldBsdTar() throws Exception {
final String file = "COMPRESS-612/test-times-oldbsdtar.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -185,7 +185,7 @@ public class FileTimesIT extends AbstractTestCase {
// Format used by GNU tar of versions prior to 1.12
// Created using GNU tar
@Test
- public void readTimeFromTarOldGnu() throws Exception {
+ public void testReadTimeFromTarOldGnu() throws Exception {
final String file = "COMPRESS-612/test-times-oldgnu.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -203,7 +203,7 @@ public class FileTimesIT extends AbstractTestCase {
// Format used by GNU tar of versions prior to 1.12
// Created using GNU tar
@Test
- public void readTimeFromTarOldGnuIncremental() throws Exception {
+ public void testReadTimeFromTarOldGnuIncremental() throws Exception {
final String file = "COMPRESS-612/test-times-oldgnu-incremental.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -230,7 +230,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended POSIX.1-2001 standard tar
// Created using s-tar 1.6, which somehow differs from GNU tar's.
@Test
- public void readTimeFromTarPax() throws Exception {
+ public void testReadTimeFromTarPax() throws Exception {
final String file = "COMPRESS-612/test-times-pax-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -261,7 +261,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended POSIX.1-2001 standard tar
// Created using GNU tar
@Test
- public void readTimeFromTarPosix() throws Exception {
+ public void testReadTimeFromTarPosix() throws Exception {
final String file = "COMPRESS-612/test-times-posix.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -279,7 +279,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended POSIX.1-2001 standard tar
// Created using BSD tar on Windows
@Test
- public void readTimeFromTarPosixLibArchive() throws Exception {
+ public void testReadTimeFromTarPosixLibArchive() throws Exception {
final String file = "COMPRESS-612/test-times-bsd-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -310,7 +310,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended POSIX.1-2001 standard tar
// Created using GNU tar on Linux
@Test
- public void readTimeFromTarPosixLinux() throws Exception {
+ public void testReadTimeFromTarPosixLinux() throws Exception {
final String file = "COMPRESS-612/test-times-posix-linux.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -327,7 +327,7 @@ public class FileTimesIT extends AbstractTestCase {
// Old star format from 1985
@Test
- public void readTimeFromTarStarFolder() throws Exception {
+ public void testReadTimeFromTarStarFolder() throws Exception {
final String file = "COMPRESS-612/test-times-star-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -356,7 +356,7 @@ public class FileTimesIT extends AbstractTestCase {
// Standard POSIX.1-1988 tar format
@Test
- public void readTimeFromTarUstar() throws Exception {
+ public void testReadTimeFromTarUstar() throws Exception {
final String file = "COMPRESS-612/test-times-ustar.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -373,7 +373,7 @@ public class FileTimesIT extends AbstractTestCase {
// Old UNIX V7 tar format
@Test
- public void readTimeFromTarV7() throws Exception {
+ public void testReadTimeFromTarV7() throws Exception {
final String file = "COMPRESS-612/test-times-v7.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -390,7 +390,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended standard tar (star 1994)
@Test
- public void readTimeFromTarXstar() throws Exception {
+ public void testReadTimeFromTarXstar() throws Exception {
final String file = "COMPRESS-612/test-times-xstar.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -407,7 +407,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended standard tar (star 1994)
@Test
- public void readTimeFromTarXstarFolder() throws Exception {
+ public void testReadTimeFromTarXstarFolder() throws Exception {
final String file = "COMPRESS-612/test-times-xstar-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -436,7 +436,7 @@ public class FileTimesIT extends AbstractTestCase {
// Extended standard tar (star 1994)
@Test
- public void readTimeFromTarXstarIncremental() throws Exception {
+ public void testReadTimeFromTarXstarIncremental() throws Exception {
final String file = "COMPRESS-612/test-times-xstar-incremental.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -462,7 +462,7 @@ public class FileTimesIT extends AbstractTestCase {
// 'xstar' format without tar signature
@Test
- public void readTimeFromTarXustar() throws Exception {
+ public void testReadTimeFromTarXustar() throws Exception {
final String file = "COMPRESS-612/test-times-xustar.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -479,7 +479,7 @@ public class FileTimesIT extends AbstractTestCase {
// 'xstar' format without tar signature
@Test
- public void readTimeFromTarXustarFolder() throws Exception {
+ public void testReadTimeFromTarXustarFolder() throws Exception {
final String file = "COMPRESS-612/test-times-xustar-folder.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
@@ -508,7 +508,7 @@ public class FileTimesIT extends AbstractTestCase {
// 'xstar' format without tar signature
@Test
- public void readTimeFromTarXustarIncremental() throws Exception {
+ public void testReadTimeFromTarXustarIncremental() throws Exception {
final String file = "COMPRESS-612/test-times-xustar-incremental.tar";
try (final InputStream in = new BufferedInputStream(Files.newInputStream(getPath(file)));
final TarArchiveInputStream tin = new TarArchiveInputStream(in)) {
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
index 54b824f4..076ca2ad 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/SparseFilesTest.java
@@ -84,7 +84,7 @@ public class SparseFilesTest extends AbstractTestCase {
}
@Test
- public void compareTarArchiveInputStreamWithTarFile() throws IOException {
+ public void testCompareTarArchiveInputStreamWithTarFile() throws IOException {
final Path file = getPath("oldgnu_sparse.tar");
try (TarArchiveInputStream tarIn = new TarArchiveInputStream(new BufferedInputStream(Files.newInputStream(file)));
TarFile tarFile = new TarFile(file)) {
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
index 6ba2c686..2bf55bb0 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveEntryTest.java
@@ -73,14 +73,14 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void getFileFromNonFileEntry() {
+ public void testGetFileFromNonFileEntry() {
final TarArchiveEntry entry = new TarArchiveEntry("test.txt");
assertNull(entry.getFile());
assertNull(entry.getPath());
}
@Test
- public void getOrderedSparseHeadersRejectsOverlappingStructs() throws Exception {
+ public void testGetOrderedSparseHeadersRejectsOverlappingStructs() throws Exception {
final TarArchiveEntry te = new TarArchiveEntry("test");
te.fillStarSparseData(Collections.singletonMap("SCHILY.realsize", "201"));
te.setSparseHeaders(Arrays.asList(new TarArchiveStructSparse(10, 5), new TarArchiveStructSparse(12, 1)));
@@ -88,7 +88,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void getOrderedSparseHeadersRejectsStructsPointingBeyondOutputEntry() throws Exception {
+ public void testGetOrderedSparseHeadersRejectsStructsPointingBeyondOutputEntry() throws Exception {
final TarArchiveEntry te = new TarArchiveEntry("test");
te.setSparseHeaders(Arrays.asList(new TarArchiveStructSparse(200, 2)));
te.fillStarSparseData(Collections.singletonMap("SCHILY.realsize", "201"));
@@ -96,7 +96,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void getOrderedSparseHeadersRejectsStructsWithReallyBigNumbers() throws Exception {
+ public void testGetOrderedSparseHeadersRejectsStructsWithReallyBigNumbers() throws Exception {
final TarArchiveEntry te = new TarArchiveEntry("test");
te.fillStarSparseData(Collections.singletonMap("SCHILY.realsize", String.valueOf(Long.MAX_VALUE)));
te.setSparseHeaders(Arrays.asList(new TarArchiveStructSparse(Long.MAX_VALUE, 2)));
@@ -104,7 +104,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void getOrderedSparseHeadersSortsAndFiltersSparseStructs() throws Exception {
+ public void testGetOrderedSparseHeadersSortsAndFiltersSparseStructs() throws Exception {
final TarArchiveEntry te = new TarArchiveEntry("test");
// hacky way to set realSize
te.fillStarSparseData(Collections.singletonMap("SCHILY.realsize", "201"));
@@ -118,7 +118,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void negativeOffsetInConstructorNotAllowed() {
+ public void testNegativeOffsetInConstructorNotAllowed() {
// @formatter:off
final byte[] entryContent = ("test1.xml\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
"\u0000" +
@@ -145,12 +145,12 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void negativeOffsetInSetterNotAllowed() {
+ public void testNegativeOffsetInSetterNotAllowed() {
assertThrows(IllegalArgumentException.class, () -> new TarArchiveEntry("test").setDataOffset(-1));
}
@Test
- public void preservesDriveSpecOnWindowsAndNetwareIfAskedTo() {
+ public void testPreservesDriveSpecOnWindowsAndNetwareIfAskedTo() {
assumeTrue("C:\\".equals(ROOT));
TarArchiveEntry t = new TarArchiveEntry(ROOT + "foo.txt", true);
assertEquals("C:/foo.txt", t.getName());
@@ -167,7 +167,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void shouldNotWriteTimePaxHeadersByDefault() throws IOException {
+ public void testShouldNotWriteTimePaxHeadersByDefault() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos)) {
final TarArchiveEntry entry = createEntryForTimeTests();
@@ -197,7 +197,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void shouldParseTimePaxHeadersAndNotCountAsExtraPaxHeaders() {
+ public void testShouldParseTimePaxHeadersAndNotCountAsExtraPaxHeaders() {
final TarArchiveEntry entry = createEntryForTimeTests();
assertEquals(0, entry.getExtraPaxHeaders().size(), "extra header count");
assertNull(entry.getExtraPaxHeader("size"), "size");
@@ -213,7 +213,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void shouldWriteTimesAsPaxHeadersForPosixMode() throws IOException {
+ public void testShouldWriteTimesAsPaxHeadersForPosixMode() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos)) {
final TarArchiveEntry entry = createEntryForTimeTests();
@@ -244,7 +244,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void shouldWriteTimesAsPaxHeadersForPosixModeAndCreationTimeShouldBeUsedAsCtime() throws IOException {
+ public void testShouldWriteTimesAsPaxHeadersForPosixModeAndCreationTimeShouldBeUsedAsCtime() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos)) {
final TarArchiveEntry entry = createEntryForTimeTests();
@@ -276,7 +276,7 @@ public class TarArchiveEntryTest implements TarConstants {
}
@Test
- public void shouldWriteTimesForStarMode() throws IOException {
+ public void testShouldWriteTimesForStarMode() throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos)) {
final TarArchiveEntry entry = createEntryForTimeTests();
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
index 5af4f26e..65442df1 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarArchiveInputStreamTest.java
@@ -63,13 +63,13 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void datePriorToEpochInGNUFormat() throws Exception {
+ public void testDatePriorToEpochInGNUFormat() throws Exception {
datePriorToEpoch("preepoch-star.tar");
}
@Test
- public void datePriorToEpochInPAXFormat() throws Exception {
+ public void testDatePriorToEpochInPAXFormat() throws Exception {
datePriorToEpoch("preepoch-posix.tar");
}
@@ -87,7 +87,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (InputStream in = newInputStream("bla.tar");
TarArchiveInputStream archive = new TarArchiveInputStream(in)) {
@@ -99,7 +99,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void readsArchiveCompletely_COMPRESS245() {
+ public void testReadsArchiveCompletely_COMPRESS245() {
try (InputStream is = TarArchiveInputStreamTest.class.getResourceAsStream("/COMPRESS-245.tar.gz")) {
final InputStream gin = new GZIPInputStream(is);
try (TarArchiveInputStream tar = new TarArchiveInputStream(gin)) {
@@ -117,7 +117,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsArchivesWithNegativeSizes() throws Exception {
+ public void testRejectsArchivesWithNegativeSizes() throws Exception {
try (InputStream in = newInputStream("COMPRESS-569.tar"); TarArchiveInputStream archive = new TarArchiveInputStream(in)) {
getNextEntryUntilIOException(archive);
}
@@ -127,7 +127,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
* This test ensures the implementation is reading the padded last block if a tool has added one to an archive
*/
@Test
- public void shouldConsumeArchiveCompletely() throws Exception {
+ public void testShouldConsumeArchiveCompletely() throws Exception {
try (InputStream is = TarArchiveInputStreamTest.class.getResourceAsStream("/archive_with_trailer.tar");
TarArchiveInputStream tar = new TarArchiveInputStream(is)) {
while (tar.getNextTarEntry() != null) {
@@ -141,7 +141,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldReadBigGid() throws Exception {
+ public void testShouldReadBigGid() throws Exception {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (TarArchiveOutputStream tos = new TarArchiveOutputStream(bos)) {
tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
@@ -164,7 +164,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-324">COMPRESS-324</a>
*/
@Test
- public void shouldReadGNULongNameEntryWithWrongName() throws Exception {
+ public void testShouldReadGNULongNameEntryWithWrongName() throws Exception {
try (TarArchiveInputStream is = getTestStream("/COMPRESS-324.tar")) {
final TarArchiveEntry entry = is.getNextTarEntry();
assertEquals("1234567890123456789012345678901234567890123456789012345678901234567890"
@@ -176,7 +176,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldThrowAnExceptionOnTruncatedEntries() throws Exception {
+ public void testShouldThrowAnExceptionOnTruncatedEntries() throws Exception {
final File dir = mkdir("COMPRESS-279");
try (TarArchiveInputStream is = getTestStream("/COMPRESS-279.tar")) {
assertThrows(IOException.class, () -> {
@@ -194,7 +194,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldUseSpecifiedEncodingWhenReadingGNULongNames()
+ public void testShouldUseSpecifiedEncodingWhenReadingGNULongNames()
throws Exception {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final String encoding = CharsetNames.UTF_16;
@@ -217,7 +217,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (InputStream in = newInputStream("bla.tar");
TarArchiveInputStream archive = new TarArchiveInputStream(in)) {
final ArchiveEntry e = archive.getNextEntry();
@@ -231,7 +231,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-417">COMPRESS-417</a>
*/
@Test
- public void skipsDevNumbersWhenEntryIsNoDevice() throws Exception {
+ public void testSkipsDevNumbersWhenEntryIsNoDevice() throws Exception {
try (TarArchiveInputStream is = getTestStream("/COMPRESS-417.tar")) {
assertEquals("test1.xml", is.getNextTarEntry().getName());
assertEquals(TarConstants.LF_NORMAL, is.getCurrentEntry().getLinkFlag());
@@ -245,7 +245,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-355">COMPRESS-355</a>
*/
@Test
- public void survivesBlankLinesInPaxHeader() throws Exception {
+ public void testSurvivesBlankLinesInPaxHeader() throws Exception {
try (TarArchiveInputStream is = getTestStream("/COMPRESS-355.tar")) {
final TarArchiveEntry entry = is.getNextTarEntry();
assertEquals("package/package.json", entry.getName());
@@ -258,7 +258,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-356">COMPRESS-356</a>
*/
@Test
- public void survivesPaxHeaderWithNameEndingInSlash() throws Exception {
+ public void testSurvivesPaxHeaderWithNameEndingInSlash() throws Exception {
try (TarArchiveInputStream is = getTestStream("/COMPRESS-356.tar")) {
final TarArchiveEntry entry = is.getNextTarEntry();
assertEquals("package/package.json", entry.getName());
@@ -428,7 +428,7 @@ public class TarArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void workaroundForBrokenTimeHeader() throws Exception {
+ public void testWorkaroundForBrokenTimeHeader() throws Exception {
try (TarArchiveInputStream in = new TarArchiveInputStream(newInputStream("simple-aix-native-tar.tar"))) {
TarArchiveEntry tae = in.getNextTarEntry();
tae = in.getNextTarEntry();
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarFileTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarFileTest.java
index b6ca2e75..6def3bf9 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarFileTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarFileTest.java
@@ -48,7 +48,7 @@ public class TarFileTest extends AbstractTestCase {
* This test ensures the implementation is reading the padded last block if a tool has added one to an archive
*/
@Test
- public void archiveWithTrailer() throws IOException {
+ public void testArchiveWithTrailer() throws IOException {
try (final SeekableByteChannel channel = Files.newByteChannel(getPath("archive_with_trailer.tar"));
final TarFile tarfile = new TarFile(channel, TarConstants.DEFAULT_BLKSIZE, TarConstants.DEFAULT_RCDSIZE, null, false)) {
final String tarAppendix = "Hello, world!\n";
@@ -72,17 +72,17 @@ public class TarFileTest extends AbstractTestCase {
}
@Test
- public void datePriorToEpochInGNUFormat() throws Exception {
+ public void testDatePriorToEpochInGNUFormat() throws Exception {
datePriorToEpoch("preepoch-star.tar");
}
@Test
- public void datePriorToEpochInPAXFormat() throws Exception {
+ public void testDatePriorToEpochInPAXFormat() throws Exception {
datePriorToEpoch("preepoch-posix.tar");
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (final TarFile tarFile = new TarFile(getPath("bla.tar"));
final InputStream input = tarFile.getInputStream(tarFile.getEntries().get(0))) {
@@ -93,7 +93,7 @@ public class TarFileTest extends AbstractTestCase {
}
@Test
- public void readsArchiveCompletely_COMPRESS245() {
+ public void testReadsArchiveCompletely_COMPRESS245() {
try {
final Path tempTar = resultDir.toPath().resolve("COMPRESS-245.tar");
try (final GZIPInputStream gin = new GZIPInputStream(
@@ -109,12 +109,12 @@ public class TarFileTest extends AbstractTestCase {
}
@Test
- public void rejectsArchivesWithNegativeSizes() throws Exception {
+ public void testRejectsArchivesWithNegativeSizes() throws Exception {
assertThrows(IOException.class, () -> new TarFile(getFile("COMPRESS-569.tar")));
}
@Test
- public void shouldReadBigGid() throws Exception {
+ public void testShouldReadBigGid() throws Exception {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (final TarArchiveOutputStream tos = new TarArchiveOutputStream(bos)) {
tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
@@ -136,7 +136,7 @@ public class TarFileTest extends AbstractTestCase {
* @link "https://issues.apache.org/jira/browse/COMPRESS-324"
*/
@Test
- public void shouldReadGNULongNameEntryWithWrongName() throws Exception {
+ public void testShouldReadGNULongNameEntryWithWrongName() throws Exception {
try (final TarFile tarFile = new TarFile(getPath("COMPRESS-324.tar"))) {
final List<TarArchiveEntry> entries = tarFile.getEntries();
assertEquals("1234567890123456789012345678901234567890123456789012345678901234567890"
@@ -148,14 +148,14 @@ public class TarFileTest extends AbstractTestCase {
}
@Test
- public void shouldThrowAnExceptionOnTruncatedEntries() throws Exception {
+ public void testShouldThrowAnExceptionOnTruncatedEntries() throws Exception {
final File dir = mkdir("COMPRESS-279");
assertThrows(IOException.class, () -> new TarFile(getPath("COMPRESS-279.tar")));
forceDelete(dir);
}
@Test
- public void shouldUseSpecifiedEncodingWhenReadingGNULongNames()
+ public void testShouldUseSpecifiedEncodingWhenReadingGNULongNames()
throws Exception {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final String encoding = CharsetNames.UTF_16;
@@ -179,7 +179,7 @@ public class TarFileTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (final TarFile tarFile = new TarFile(getPath("bla.tar"));
final InputStream input = tarFile.getInputStream(tarFile.getEntries().get(0))) {
IOUtils.toByteArray(input);
@@ -192,7 +192,7 @@ public class TarFileTest extends AbstractTestCase {
* @link "https://issues.apache.org/jira/browse/COMPRESS-417"
*/
@Test
- public void skipsDevNumbersWhenEntryIsNoDevice() throws Exception {
+ public void testSkipsDevNumbersWhenEntryIsNoDevice() throws Exception {
try (final TarFile tarFile = new TarFile(getPath("COMPRESS-417.tar"))) {
final List<TarArchiveEntry> entries = tarFile.getEntries();
assertEquals(2, entries.size());
@@ -207,7 +207,7 @@ public class TarFileTest extends AbstractTestCase {
* @link "https://issues.apache.org/jira/browse/COMPRESS-355"
*/
@Test
- public void survivesBlankLinesInPaxHeader() throws Exception {
+ public void testSurvivesBlankLinesInPaxHeader() throws Exception {
try (final TarFile tarFile = new TarFile(getPath("COMPRESS-355.tar"))) {
final List<TarArchiveEntry> entries = tarFile.getEntries();
assertEquals(1, entries.size());
@@ -220,7 +220,7 @@ public class TarFileTest extends AbstractTestCase {
* @link "https://issues.apache.org/jira/browse/COMPRESS-356"
*/
@Test
- public void survivesPaxHeaderWithNameEndingInSlash() throws Exception {
+ public void testSurvivesPaxHeaderWithNameEndingInSlash() throws Exception {
try (final TarFile tarFile = new TarFile(getPath("COMPRESS-356.tar"))) {
final List<TarArchiveEntry> entries = tarFile.getEntries();
assertEquals(1, entries.size());
@@ -343,7 +343,7 @@ public class TarFileTest extends AbstractTestCase {
}
@Test
- public void workaroundForBrokenTimeHeader() throws IOException {
+ public void testWorkaroundForBrokenTimeHeader() throws IOException {
try (final TarFile tarFile = new TarFile(getPath("simple-aix-native-tar.tar"))) {
final List<TarArchiveEntry> entries = tarFile.getEntries();
assertEquals(3, entries.size());
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarMemoryFileSystemTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarMemoryFileSystemTest.java
index 4e6c628b..076ddbb2 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarMemoryFileSystemTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarMemoryFileSystemTest.java
@@ -42,7 +42,7 @@ import com.github.marschall.memoryfilesystem.MemoryFileSystemBuilder;
public class TarMemoryFileSystemTest {
@Test
- public void checkUserInformationInTarEntry() throws IOException, ArchiveException {
+ public void testCheckUserInformationInTarEntry() throws IOException, ArchiveException {
final String user = "commons";
final String group = "compress";
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().addUser(user).addGroup(group).build()) {
diff --git a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
index 72ff3370..314b52be 100644
--- a/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
@@ -69,7 +69,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parseFromPAX01SparseHeaders() throws Exception {
+ public void testParseFromPAX01SparseHeaders() throws Exception {
final String map = "0,10,20,0,20,5";
final List<TarArchiveStructSparse> sparse = TarUtils.parseFromPAX01SparseHeaders(map);
assertEquals(3, sparse.size());
@@ -82,39 +82,39 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parseFromPAX01SparseHeadersRejectsNegativeNumbytes() throws Exception {
+ public void testParseFromPAX01SparseHeadersRejectsNegativeNumbytes() throws Exception {
assertThrows(IOException.class, () -> TarUtils.parseFromPAX01SparseHeaders("0,10,20,0,20,-5"));
}
@Test
- public void parseFromPAX01SparseHeadersRejectsNegativeOffset() throws Exception {
+ public void testParseFromPAX01SparseHeadersRejectsNegativeOffset() throws Exception {
assertThrows(IOException.class, () -> TarUtils.parseFromPAX01SparseHeaders("0,10,20,0,-2,5"));
}
@Test
- public void parseFromPAX01SparseHeadersRejectsNonNumericNumbytes() throws Exception {
+ public void testParseFromPAX01SparseHeadersRejectsNonNumericNumbytes() throws Exception {
assertThrows(IOException.class, () -> TarUtils.parseFromPAX01SparseHeaders("0,10,20,0,20,b"));
}
@Test
- public void parseFromPAX01SparseHeadersRejectsNonNumericOffset() throws Exception {
+ public void testParseFromPAX01SparseHeadersRejectsNonNumericOffset() throws Exception {
assertThrows(IOException.class, () -> TarUtils.parseFromPAX01SparseHeaders("0,10,20,0,2a,5"));
}
@Test
- public void parseFromPAX01SparseHeadersRejectsOddNumberOfEntries() throws Exception {
+ public void testParseFromPAX01SparseHeadersRejectsOddNumberOfEntries() throws Exception {
final String map = "0,10,20,0,20";
assertThrows(IOException.class, () -> TarUtils.parseFromPAX01SparseHeaders(map));
}
@Test
- public void parsePAX01SparseHeadersRejectsOddNumberOfEntries() {
+ public void testParsePAX01SparseHeadersRejectsOddNumberOfEntries() {
final String map = "0,10,20,0,20";
assertThrows(UncheckedIOException.class, () -> TarUtils.parsePAX01SparseHeaders(map));
}
@Test
- public void parsePAX1XSparseHeaders() throws Exception {
+ public void testParsePAX1XSparseHeaders() throws Exception {
final byte[] header = ("1\n"
+ "0\n"
+ "20\n")
@@ -131,7 +131,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parsePAX1XSparseHeadersRejectsIncompleteLastLine() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsIncompleteLastLine() throws Exception {
final byte[] header = ("1\n"
+ "0\n"
+ "20")
@@ -142,7 +142,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parsePAX1XSparseHeadersRejectsNegativeNumberOfEntries() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsNegativeNumberOfEntries() throws Exception {
final byte[] header = ("111111111111111111111111111111111111111111111111111111111111111\n"
+ "0\n"
+ "20\n")
@@ -155,7 +155,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parsePAX1XSparseHeadersRejectsNegativeNumbytes() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsNegativeNumbytes() throws Exception {
final byte[] header = ("1\n"
+ "0\n"
+ "111111111111111111111111111111111111111111111111111111111111111\n")
@@ -168,7 +168,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parsePAX1XSparseHeadersRejectsNegativeOffset() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsNegativeOffset() throws Exception {
final byte[] header = ("1\n"
+ "111111111111111111111111111111111111111111111111111111111111111\n"
+ "20\n")
@@ -181,7 +181,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parsePAX1XSparseHeadersRejectsNonNumericNumberOfEntries() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsNonNumericNumberOfEntries() throws Exception {
final byte[] header = ("x\n"
+ "0\n"
+ "20\n")
@@ -194,7 +194,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void parsePAX1XSparseHeadersRejectsNonNumericNumbytes() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsNonNumericNumbytes() throws Exception {
final byte[] header = ("1\n"
+ "0\n"
+ "2x\n")
@@ -208,7 +208,7 @@ public class TarUtilsTest extends AbstractTestCase {
@Test
- public void parsePAX1XSparseHeadersRejectsNonNumericOffset() throws Exception {
+ public void testParsePAX1XSparseHeadersRejectsNonNumericOffset() throws Exception {
final byte[] header = ("1\n"
+ "x\n"
+ "20\n")
@@ -221,7 +221,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void paxHeaderEntryWithEmptyValueRemovesKey() throws Exception {
+ public void testPaxHeaderEntryWithEmptyValueRemovesKey() throws Exception {
final Map<String, String> headers = TarUtils
.parsePaxHeaders(new ByteArrayInputStream("11 foo=bar\n7 foo=\n"
.getBytes(UTF_8)), null, new HashMap<>());
@@ -229,7 +229,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readNonAsciiPaxHeader() throws Exception {
+ public void testReadNonAsciiPaxHeader() throws Exception {
final String ae = "\u00e4";
final String line = "11 path="+ ae + "\n";
assertEquals(11, line.getBytes(UTF_8).length);
@@ -240,7 +240,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPax00SparseHeader() throws Exception {
+ public void testReadPax00SparseHeader() throws Exception {
final String header = "23 GNU.sparse.offset=0\n26 GNU.sparse.numbytes=10\n";
final List<TarArchiveStructSparse> sparseHeaders = new ArrayList<>();
TarUtils.parsePaxHeaders(
@@ -252,7 +252,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPax00SparseHeaderMakesNumbytesOptional() throws Exception {
+ public void testReadPax00SparseHeaderMakesNumbytesOptional() throws Exception {
final String header = "23 GNU.sparse.offset=0\n24 GNU.sparse.offset=10\n";
final List<TarArchiveStructSparse> sparseHeaders = new ArrayList<>();
TarUtils.parsePaxHeaders(
@@ -266,7 +266,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPax00SparseHeaderRejectsNegativeNumbytes() throws Exception {
+ public void testReadPax00SparseHeaderRejectsNegativeNumbytes() throws Exception {
final String header = "23 GNU.sparse.offset=0\n26 GNU.sparse.numbytes=-1\n";
assertThrows(IOException.class, () -> TarUtils.parsePaxHeaders(
new ByteArrayInputStream(header.getBytes(UTF_8)),
@@ -274,7 +274,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPax00SparseHeaderRejectsNegativeOffset() throws Exception {
+ public void testReadPax00SparseHeaderRejectsNegativeOffset() throws Exception {
final String header = "24 GNU.sparse.offset=-1\n26 GNU.sparse.numbytes=10\n";
assertThrows(IOException.class, () -> TarUtils.parsePaxHeaders(
new ByteArrayInputStream(header.getBytes(UTF_8)),
@@ -282,7 +282,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPax00SparseHeaderRejectsNonNumericNumbytes() throws Exception {
+ public void testReadPax00SparseHeaderRejectsNonNumericNumbytes() throws Exception {
final String header = "23 GNU.sparse.offset=0\n26 GNU.sparse.numbytes=1a\n";
assertThrows(IOException.class, () -> TarUtils.parsePaxHeaders(
new ByteArrayInputStream(header.getBytes(UTF_8)),
@@ -290,7 +290,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPax00SparseHeaderRejectsNonNumericOffset() throws Exception {
+ public void testReadPax00SparseHeaderRejectsNonNumericOffset() throws Exception {
final String header = "23 GNU.sparse.offset=a\n26 GNU.sparse.numbytes=10\n";
assertThrows(IOException.class, () -> TarUtils.parsePaxHeaders(
new ByteArrayInputStream(header.getBytes(UTF_8)),
@@ -298,7 +298,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPaxHeaderWithEmbeddedNewline() throws Exception {
+ public void testReadPaxHeaderWithEmbeddedNewline() throws Exception {
final Map<String, String> headers = TarUtils
.parsePaxHeaders(new ByteArrayInputStream("28 comment=line1\nline2\nand3\n"
.getBytes(UTF_8)), null, new HashMap<>());
@@ -307,14 +307,14 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readPaxHeaderWithoutTrailingNewline() throws Exception {
+ public void testReadPaxHeaderWithoutTrailingNewline() throws Exception {
assertThrows(IOException.class, () -> TarUtils.parsePaxHeaders(
new ByteArrayInputStream("30 atime=1321711775.9720594634".getBytes(UTF_8)),
null, Collections.emptyMap()));
}
@Test
- public void readSimplePaxHeader() throws Exception {
+ public void testReadSimplePaxHeader() throws Exception {
final Map<String, String> headers = TarUtils.parsePaxHeaders(
new ByteArrayInputStream("30 atime=1321711775.972059463\n".getBytes(UTF_8)),
null, new HashMap<>());
@@ -323,7 +323,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readSparseStructsBinary() throws Exception {
+ public void testReadSparseStructsBinary() throws Exception {
final byte[] header = {
(byte) 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(byte) 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,
@@ -336,7 +336,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readSparseStructsOctal() throws Exception {
+ public void testReadSparseStructsOctal() throws Exception {
final byte[] header = "00000000000 00000000007 ".getBytes();
assertEquals(24, header.length);
final List<TarArchiveStructSparse> sparse = TarUtils.readSparseStructs(header, 0, 1);
@@ -346,7 +346,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readSparseStructsRejectsNegativeNumbytes() throws Exception {
+ public void testReadSparseStructsRejectsNegativeNumbytes() throws Exception {
final byte[] header = {
(byte) 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
@@ -356,7 +356,7 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readSparseStructsRejectsNegativeOffset() throws Exception {
+ public void testReadSparseStructsRejectsNegativeOffset() throws Exception {
final byte[] header = {
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
@@ -366,19 +366,19 @@ public class TarUtilsTest extends AbstractTestCase {
}
@Test
- public void readSparseStructsRejectsNonNumericNumbytes() throws Exception {
+ public void testReadSparseStructsRejectsNonNumericNumbytes() throws Exception {
final byte[] header = "00000000000 0000000000x ".getBytes();
assertThrows(IOException.class, () -> TarUtils.readSparseStructs(header, 0, 1));
}
@Test
- public void readSparseStructsRejectsNonNumericOffset() throws Exception {
+ public void testReadSparseStructsRejectsNonNumericOffset() throws Exception {
final byte[] header = "0000000000x 00000000007 ".getBytes();
assertThrows(IOException.class, () -> TarUtils.readSparseStructs(header, 0, 1));
}
@Test
- public void secondEntryWinsWhenPaxHeaderContainsDuplicateKey() throws Exception {
+ public void testSecondEntryWinsWhenPaxHeaderContainsDuplicateKey() throws Exception {
final Map<String, String> headers = TarUtils.parsePaxHeaders(new ByteArrayInputStream("11 foo=bar\n11 foo=baz\n"
.getBytes(UTF_8)), null, new HashMap<>());
assertEquals(1, headers.size());
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
index 02d430d1..a006aa4a 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTest.java
@@ -88,7 +88,7 @@ public class ExtraFieldUtilsTest implements UnixStat {
private byte[] aLocal;
@Test
- public void parseTurnsArrayIndexOutOfBoundsIntoZipException() {
+ public void testParseTurnsArrayIndexOutOfBoundsIntoZipException() {
ExtraFieldUtils.register(AiobThrowingExtraField.class);
final AiobThrowingExtraField f = new AiobThrowingExtraField();
final byte[] d = new byte[4 + AiobThrowingExtraField.LENGTH];
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/NioZipEncodingTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/NioZipEncodingTest.java
index 35e196c6..a04c36e2 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/NioZipEncodingTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/NioZipEncodingTest.java
@@ -38,7 +38,7 @@ public class NioZipEncodingTest {
private static final String RAINBOW_EMOJI = "\ud83c\udf08";
@Test
- public void partialSurrogatePair() {
+ public void testPartialSurrogatePair() {
final NioZipEncoding e = new NioZipEncoding(US_ASCII, false);
final ByteBuffer bb = e.encode("\ud83c");
final int off = bb.arrayOffset();
@@ -47,7 +47,7 @@ public class NioZipEncodingTest {
}
@Test
- public void rainbowEmojiToSurrogatePairUTF16() {
+ public void testRainbowEmojiToSurrogatePairUTF16() {
final NioZipEncoding e = new NioZipEncoding(UTF_16BE, false);
final ByteBuffer bb = e.encode(RAINBOW_EMOJI);
final int off = bb.arrayOffset();
@@ -56,7 +56,7 @@ public class NioZipEncodingTest {
}
@Test
- public void umlautToISO88591() {
+ public void testUmlautToISO88591() {
final NioZipEncoding e = new NioZipEncoding(ISO_8859_1, true);
final ByteBuffer bb = e.encode("\u00e4\u00f6\u00fc");
final int off = bb.arrayOffset();
@@ -65,7 +65,7 @@ public class NioZipEncodingTest {
}
@Test
- public void umlautToUTF16BE() {
+ public void testUmlautToUTF16BE() {
final NioZipEncoding e = new NioZipEncoding(UTF_16BE, false);
final ByteBuffer bb = e.encode(UMLAUTS);
final int off = bb.arrayOffset();
@@ -74,7 +74,7 @@ public class NioZipEncodingTest {
}
@Test
- public void umlautToUTF8() {
+ public void testUmlautToUTF8() {
final NioZipEncoding e = new NioZipEncoding(UTF_8, true);
final ByteBuffer bb = e.encode("\u00e4\u00f6\u00fc");
final int off = bb.arrayOffset();
@@ -83,7 +83,7 @@ public class NioZipEncodingTest {
}
@Test
- public void unmappableRainbowEmoji() {
+ public void testUnmappableRainbowEmoji() {
final NioZipEncoding e = new NioZipEncoding(US_ASCII, false);
final ByteBuffer bb = e.encode(RAINBOW_EMOJI);
final int off = bb.arrayOffset();
@@ -92,7 +92,7 @@ public class NioZipEncodingTest {
}
@Test
- public void unmappableUmlauts() {
+ public void testUnmappableUmlauts() {
final NioZipEncoding e = new NioZipEncoding(US_ASCII, false);
final ByteBuffer bb = e.encode("\u00e4\u00f6\u00fc");
final int off = bb.arrayOffset();
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
index 3aef6db9..0e615479 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
@@ -96,20 +96,20 @@ public class ParallelScatterZipCreatorTest {
}
@Test
- public void callableApiUsingSubmit() throws Exception {
+ public void testCallableApiUsingSubmit() throws Exception {
result = File.createTempFile("parallelScatterGather2", "");
callableApi(zipCreator -> zipCreator::submit);
}
@Test
- public void callableApiUsingSubmitStreamAwareCallable() throws Exception {
+ public void testCallableApiUsingSubmitStreamAwareCallable() throws Exception {
result = File.createTempFile("parallelScatterGather3", "");
callableApi(zipCreator -> zipCreator::submitStreamAwareCallable);
}
@Test
- public void callableApiWithHighestLevelUsingSubmitStreamAwareCallable() throws Exception {
+ public void testCallableApiWithHighestLevelUsingSubmitStreamAwareCallable() throws Exception {
result = File.createTempFile("parallelScatterGather5", "");
callableApiWithTestFiles(zipCreator -> zipCreator::submitStreamAwareCallable, Deflater.BEST_COMPRESSION);
}
@@ -144,7 +144,7 @@ public class ParallelScatterZipCreatorTest {
}
@Test
- public void callableWithLowestLevelApiUsingSubmit() throws Exception {
+ public void testCallableWithLowestLevelApiUsingSubmit() throws Exception {
result = File.createTempFile("parallelScatterGather4", "");
callableApiWithTestFiles(zipCreator -> zipCreator::submit, Deflater.NO_COMPRESSION);
}
@@ -156,7 +156,7 @@ public class ParallelScatterZipCreatorTest {
}
@Test
- public void concurrentCustomTempFolder()
+ public void testConcurrentCustomTempFolder()
throws Exception {
result = File.createTempFile("parallelScatterGather1", "");
final ParallelScatterZipCreator zipCreator;
@@ -180,7 +180,7 @@ public class ParallelScatterZipCreatorTest {
}
@Test
- public void concurrentDefaultTempFolder() throws Exception {
+ public void testConcurrentDefaultTempFolder() throws Exception {
result = File.createTempFile("parallelScatterGather1", "");
final ParallelScatterZipCreator zipCreator;
final Map<String, byte[]> entries;
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ScatterZipOutputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ScatterZipOutputStreamTest.java
index 8c7e9e9a..077f6a0e 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ScatterZipOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ScatterZipOutputStreamTest.java
@@ -47,7 +47,7 @@ public class ScatterZipOutputStreamTest {
}
@Test
- public void putArchiveEntry() throws Exception {
+ public void testPutArchiveEntry() throws Exception {
scatterFile = File.createTempFile("scattertest", ".notzip");
final byte[] B_PAYLOAD = "RBBBBBBS".getBytes();
final byte[] A_PAYLOAD = "XAAY".getBytes();
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/StreamCompressorTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/StreamCompressorTest.java
index a25fa1d5..5ec1a238 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/StreamCompressorTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/StreamCompressorTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
public class StreamCompressorTest {
@Test
- public void deflatedEntries() throws Exception {
+ public void testDeflatedEntries() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (StreamCompressor sc = StreamCompressor.create(baos)) {
sc.deflate(new ByteArrayInputStream("AAAAAABBBBBB".getBytes()), ZipEntry.DEFLATED);
@@ -49,7 +49,7 @@ public class StreamCompressorTest {
}
@Test
- public void storedEntries() throws Exception {
+ public void testStoredEntries() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (StreamCompressor sc = StreamCompressor.create(baos)) {
sc.deflate(new ByteArrayInputStream("A".getBytes()), ZipEntry.STORED);
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
index 5aed4731..407b9927 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
@@ -203,7 +203,7 @@ public class UTF8ZipFilesTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-479">COMPRESS-479</a>
*/
@Test
- public void streamSkipsOverUnicodeExtraFieldWithUnsupportedVersion() throws IOException {
+ public void testStreamSkipsOverUnicodeExtraFieldWithUnsupportedVersion() throws IOException {
try (InputStream archive = newInputStream("COMPRESS-479.zip");
ZipArchiveInputStream zi = new ZipArchiveInputStream(archive)) {
assertEquals(OIL_BARREL_TXT, zi.getNextEntry().getName());
@@ -399,7 +399,7 @@ public class UTF8ZipFilesTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-479">COMPRESS-479</a>
*/
@Test
- public void zipFileSkipsOverUnicodeExtraFieldWithUnsupportedVersion() throws IOException {
+ public void testZipFileSkipsOverUnicodeExtraFieldWithUnsupportedVersion() throws IOException {
try (ZipFile zf = new ZipFile(getFile("COMPRESS-479.zip"))) {
assertNotNull(zf.getEntry(ASCII_TXT));
assertNotNull(zf.getEntry("%U20AC_for_Dollar.txt"));
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java
index 954c931d..36b71c63 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/X000A_NTFSTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
public class X000A_NTFSTest {
@Test
- public void simpleRoundtrip() throws Exception {
+ public void testSimpleRoundtrip() throws Exception {
final X000A_NTFS xf = new X000A_NTFS();
xf.setModifyJavaTime(new Date(0));
// one second past midnight
@@ -44,7 +44,7 @@ public class X000A_NTFSTest {
}
@Test
- public void simpleRoundtripWithHighPrecisionDatesWithBigValues() throws Exception {
+ public void testSimpleRoundtripWithHighPrecisionDatesWithBigValues() throws Exception {
final X000A_NTFS xf = new X000A_NTFS();
xf.setModifyFileTime(FileTime.from(Instant.ofEpochSecond(123456789101L, 123456700)));
// one second past midnight
@@ -64,7 +64,7 @@ public class X000A_NTFSTest {
}
@Test
- public void simpleRoundtripWithHighPrecisionDatesWithSmallValues() throws Exception {
+ public void testSimpleRoundtripWithHighPrecisionDatesWithSmallValues() throws Exception {
final X000A_NTFS xf = new X000A_NTFS();
// The last 2 digits should not be written due to the 100ns precision
xf.setModifyFileTime(FileTime.from(Instant.ofEpochSecond(0, 1234)));
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
index 5649f4a4..2b4a3c5e 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
@@ -160,7 +160,7 @@ public class X5455_ExtendedTimestampTest {
}
@Test
- public void resetsFlagsWhenLocalFileArrayIsTooShort() throws Exception {
+ public void testResetsFlagsWhenLocalFileArrayIsTooShort() throws Exception {
final byte[] local = {
7
}; // claims all three time values would be present, but they are not
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
index c4826aa4..9f352a83 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
@@ -2047,65 +2047,65 @@ public class Zip64SupportIT {
return outputFile;
}
- @Test public void read100KFilesGeneratedBy7ZIPUsingInputStream()
+ @Test public void testRead100KFilesGeneratedBy7ZIPUsingInputStream()
throws Throwable {
read100KFilesImpl(get100KFileFileGeneratedBy7ZIP());
}
- @Test public void read100KFilesGeneratedBy7ZIPUsingZipFile()
+ @Test public void testRead100KFilesGeneratedBy7ZIPUsingZipFile()
throws Throwable {
read100KFilesUsingZipFileImpl(get100KFileFileGeneratedBy7ZIP());
}
- @Test public void read100KFilesGeneratedByJava7JarUsingInputStream()
+ @Test public void testRead100KFilesGeneratedByJava7JarUsingInputStream()
throws Throwable {
read100KFilesImpl(get100KFileFileGeneratedByJava7Jar());
}
- @Test public void read100KFilesGeneratedByJava7JarUsingZipFile()
+ @Test public void testRead100KFilesGeneratedByJava7JarUsingZipFile()
throws Throwable {
read100KFilesUsingZipFileImpl(get100KFileFileGeneratedByJava7Jar());
}
- @Test public void read100KFilesGeneratedByPKZipUsingInputStream()
+ @Test public void testRead100KFilesGeneratedByPKZipUsingInputStream()
throws Throwable {
read100KFilesImpl(get100KFileFileGeneratedByPKZip());
}
- @Test public void read100KFilesGeneratedByPKZipUsingZipFile()
+ @Test public void testRead100KFilesGeneratedByPKZipUsingZipFile()
throws Throwable {
read100KFilesUsingZipFileImpl(get100KFileFileGeneratedByPKZip());
}
- @Test public void read100KFilesGeneratedByWinCFUsingInputStream()
+ @Test public void testRead100KFilesGeneratedByWinCFUsingInputStream()
throws Throwable {
read100KFilesImpl(get100KFileFileGeneratedByWinCF());
}
- @Test public void read100KFilesGeneratedByWinCFUsingZipFile()
+ @Test public void testRead100KFilesGeneratedByWinCFUsingZipFile()
throws Throwable {
read100KFilesUsingZipFileImpl(get100KFileFileGeneratedByWinCF());
}
- @Test public void read100KFilesGeneratedByWinZIPUsingInputStream()
+ @Test public void testRead100KFilesGeneratedByWinZIPUsingInputStream()
throws Throwable {
read100KFilesImpl(get100KFileFileGeneratedByWinZIP());
}
- @Test public void read100KFilesGeneratedByWinZIPUsingZipFile()
+ @Test public void testRead100KFilesGeneratedByWinZIPUsingZipFile()
throws Throwable {
read100KFilesUsingZipFileImpl(get100KFileFileGeneratedByWinZIP());
}
- @Test public void read100KFilesUsingInputStream() throws Throwable {
+ @Test public void testRead100KFilesUsingInputStream() throws Throwable {
read100KFilesImpl(get100KFileFile());
}
- @Test public void read100KFilesUsingZipFile() throws Throwable {
+ @Test public void testRead100KFilesUsingZipFile() throws Throwable {
read100KFilesUsingZipFileImpl(get100KFileFile());
}
- @Test public void read3EntriesCreatingBigArchiveFileUsingZipFile()
+ @Test public void testRead3EntriesCreatingBigArchiveFileUsingZipFile()
throws Throwable {
withTemporaryArchive("read3EntriesCreatingBigArchiveFileUsingZipFile",
(f, zos) -> {
@@ -2139,60 +2139,60 @@ public class Zip64SupportIT {
true);
}
- @Test public void read5GBOfZerosGeneratedBy7ZIPUsingInputStream()
+ @Test public void testRead5GBOfZerosGeneratedBy7ZIPUsingInputStream()
throws Throwable {
read5GBOfZerosImpl(get5GBZerosFileGeneratedBy7ZIP(), "5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedBy7ZIPUsingZipFile()
+ @Test public void testRead5GBOfZerosGeneratedBy7ZIPUsingZipFile()
throws Throwable {
read5GBOfZerosUsingZipFileImpl(get5GBZerosFileGeneratedBy7ZIP(),
"5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedByJava7JarUsingInputStream()
+ @Test public void testRead5GBOfZerosGeneratedByJava7JarUsingInputStream()
throws Throwable {
read5GBOfZerosImpl(get5GBZerosFileGeneratedByJava7Jar(), "5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedByJava7JarUsingZipFile()
+ @Test public void testRead5GBOfZerosGeneratedByJava7JarUsingZipFile()
throws Throwable {
read5GBOfZerosUsingZipFileImpl(get5GBZerosFileGeneratedByJava7Jar(),
"5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedByPKZipUsingInputStream()
+ @Test public void testRead5GBOfZerosGeneratedByPKZipUsingInputStream()
throws Throwable {
read5GBOfZerosImpl(get5GBZerosFileGeneratedByPKZip(),
"zip6/5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedByPKZipUsingZipFile()
+ @Test public void testRead5GBOfZerosGeneratedByPKZipUsingZipFile()
throws Throwable {
read5GBOfZerosUsingZipFileImpl(get5GBZerosFileGeneratedByPKZip(),
"zip6/5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedByWinZIPUsingInputStream()
+ @Test public void testRead5GBOfZerosGeneratedByWinZIPUsingInputStream()
throws Throwable {
read5GBOfZerosImpl(get5GBZerosFileGeneratedByWinZIP(), "5GB_of_Zeros");
}
- @Test public void read5GBOfZerosGeneratedByWinZIPUsingZipFile()
+ @Test public void testRead5GBOfZerosGeneratedByWinZIPUsingZipFile()
throws Throwable {
read5GBOfZerosUsingZipFileImpl(get5GBZerosFileGeneratedByWinZIP(),
"5GB_of_Zeros");
}
- @Test public void read5GBOfZerosUsingInputStream() throws Throwable {
+ @Test public void testRead5GBOfZerosUsingInputStream() throws Throwable {
read5GBOfZerosImpl(get5GBZerosFile(), "5GB_of_Zeros");
}
- @Test public void read5GBOfZerosUsingZipFile() throws Throwable {
+ @Test public void testRead5GBOfZerosUsingZipFile() throws Throwable {
read5GBOfZerosUsingZipFileImpl(get5GBZerosFile(), "5GB_of_Zeros");
}
- @Test public void readSelfGenerated100KFilesUsingZipFile()
+ @Test public void testReadSelfGenerated100KFilesUsingZipFile()
throws Throwable {
withTemporaryArchive("readSelfGenerated100KFilesUsingZipFile()",
(f, zos) -> {
@@ -2236,68 +2236,68 @@ public class Zip64SupportIT {
}
}
- @Test public void write100KFilesFile() throws Throwable {
+ @Test public void testWrite100KFilesFile() throws Throwable {
withTemporaryArchive("write100KFilesFile", write100KFiles(), true);
}
- @Test public void write100KFilesFileModeAlways() throws Throwable {
+ @Test public void testWrite100KFilesFileModeAlways() throws Throwable {
withTemporaryArchive("write100KFilesFileModeAlways",
write100KFiles(Zip64Mode.Always), true);
}
- @Test public void write100KFilesFileModeNever() throws Throwable {
+ @Test public void testWrite100KFilesFileModeNever() throws Throwable {
withTemporaryArchive("write100KFilesFileModeNever",
write100KFilesModeNever, true);
}
- @Test public void write100KFilesStream() throws Throwable {
+ @Test public void testWrite100KFilesStream() throws Throwable {
withTemporaryArchive("write100KFilesStream", write100KFiles(), false);
}
- @Test public void write100KFilesStreamModeAlways() throws Throwable {
+ @Test public void testWrite100KFilesStreamModeAlways() throws Throwable {
withTemporaryArchive("write100KFilesStreamModeAlways",
write100KFiles(Zip64Mode.Always), false);
}
- @Test public void write100KFilesStreamModeNever() throws Throwable {
+ @Test public void testWrite100KFilesStreamModeNever() throws Throwable {
withTemporaryArchive("write100KFilesStreamModeNever",
write100KFilesModeNever, false);
}
- @Test public void write3EntriesCreatingBigArchiveFile() throws Throwable {
+ @Test public void testWrite3EntriesCreatingBigArchiveFile() throws Throwable {
withTemporaryArchive("write3EntriesCreatingBigArchiveFile",
write3EntriesCreatingBigArchive(),
true);
}
- @Test public void write3EntriesCreatingBigArchiveFileModeAlways()
+ @Test public void testWrite3EntriesCreatingBigArchiveFileModeAlways()
throws Throwable {
withTemporaryArchive("write3EntriesCreatingBigArchiveFileModeAlways",
write3EntriesCreatingBigArchive(Zip64Mode.Always),
true);
}
- @Test public void write3EntriesCreatingBigArchiveFileModeNever()
+ @Test public void testWrite3EntriesCreatingBigArchiveFileModeNever()
throws Throwable {
withTemporaryArchive("write3EntriesCreatingBigArchiveFileModeNever",
write3EntriesCreatingBigArchiveModeNever,
true);
}
- @Test public void write3EntriesCreatingBigArchiveStream() throws Throwable {
+ @Test public void testWrite3EntriesCreatingBigArchiveStream() throws Throwable {
withTemporaryArchive("write3EntriesCreatingBigArchiveStream",
write3EntriesCreatingBigArchive(),
false);
}
- @Test public void write3EntriesCreatingBigArchiveStreamModeAlways()
+ @Test public void testWrite3EntriesCreatingBigArchiveStreamModeAlways()
throws Throwable {
withTemporaryArchive("write3EntriesCreatingBigArchiveStreamModeAlways",
write3EntriesCreatingBigArchive(Zip64Mode.Always),
false);
}
- @Test public void write3EntriesCreatingBigArchiveStreamModeNever()
+ @Test public void testWrite3EntriesCreatingBigArchiveStreamModeNever()
throws Throwable {
withTemporaryArchive("write3EntriesCreatingBigArchiveStreamModeNever",
write3EntriesCreatingBigArchiveModeNever,
@@ -2305,7 +2305,7 @@ public class Zip64SupportIT {
}
@Test
- public void write3EntriesCreatingManySplitArchiveFileModeAlways()
+ public void testWrite3EntriesCreatingManySplitArchiveFileModeAlways()
throws Throwable {
// about 76,293 ZIP split segments will be created
withTemporaryArchive("write3EntriesCreatingManySplitArchiveFileModeAlways",
@@ -2314,14 +2314,14 @@ public class Zip64SupportIT {
}
@Test
- public void write3EntriesCreatingManySplitArchiveFileModeNever()
+ public void testWrite3EntriesCreatingManySplitArchiveFileModeNever()
throws Throwable {
withTemporaryArchive("write3EntriesCreatingManySplitArchiveFileModeNever",
write3EntriesCreatingBigArchiveModeNever,
true, 65536L);
}
- @Test public void writeAndRead5GBOfZerosUsingZipFile() throws Throwable {
+ @Test public void testWriteAndRead5GBOfZerosUsingZipFile() throws Throwable {
File f = null;
try {
f = write5GBZerosFile("writeAndRead5GBOfZerosUsingZipFile");
@@ -2333,28 +2333,28 @@ public class Zip64SupportIT {
}
}
- @Test public void writeBigDeflatedEntryKnownSizeToFile()
+ @Test public void testWriteBigDeflatedEntryKnownSizeToFile()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryKnownSizeToFile",
writeBigDeflatedEntryToFile(true),
true);
}
- @Test public void writeBigDeflatedEntryKnownSizeToFileModeAlways()
+ @Test public void testWriteBigDeflatedEntryKnownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryKnownSizeToFileModeAlways",
writeBigDeflatedEntryToFile(true, Zip64Mode.Always),
true);
}
- @Test public void writeBigDeflatedEntryKnownSizeToFileModeNever()
+ @Test public void testWriteBigDeflatedEntryKnownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryKnownSizeToFileModeNever",
writeBigDeflatedEntryToFileModeNever(true),
true);
}
- @Test public void writeBigDeflatedEntryKnownSizeToStream()
+ @Test public void testWriteBigDeflatedEntryKnownSizeToStream()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryKnownSizeToStream",
writeBigDeflatedEntryToStream(true,
@@ -2362,7 +2362,7 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeBigDeflatedEntryKnownSizeToStreamModeAlways()
+ @Test public void testWriteBigDeflatedEntryKnownSizeToStreamModeAlways()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryKnownSizeToStreamModeAlways",
writeBigDeflatedEntryToStream(true,
@@ -2370,7 +2370,7 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeBigDeflatedEntryKnownSizeToStreamModeNever()
+ @Test public void testWriteBigDeflatedEntryKnownSizeToStreamModeNever()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryKnownSizeToStreamModeNever",
(f, zos) -> {
@@ -2386,14 +2386,14 @@ public class Zip64SupportIT {
}, false);
}
- @Test public void writeBigDeflatedEntryUnknownSizeToFile()
+ @Test public void testWriteBigDeflatedEntryUnknownSizeToFile()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryUnknownSizeToFile",
writeBigDeflatedEntryToFile(false),
true);
}
- @Test public void writeBigDeflatedEntryUnknownSizeToFileModeAlways()
+ @Test public void testWriteBigDeflatedEntryUnknownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryUnknownSizeToFileModeAlways",
writeBigDeflatedEntryToFile(false,
@@ -2401,14 +2401,14 @@ public class Zip64SupportIT {
true);
}
- @Test public void writeBigDeflatedEntryUnknownSizeToFileModeNever()
+ @Test public void testWriteBigDeflatedEntryUnknownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryUnknownSizeToFileModeNever",
writeBigDeflatedEntryToFileModeNever(false),
true);
}
- @Test public void writeBigDeflatedEntryUnknownSizeToStream()
+ @Test public void testWriteBigDeflatedEntryUnknownSizeToStream()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryUnknownSizeToStream",
writeBigDeflatedEntryUnknownSizeToStream(Zip64Mode
@@ -2416,7 +2416,7 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeBigDeflatedEntryUnknownSizeToStreamModeAlways()
+ @Test public void testWriteBigDeflatedEntryUnknownSizeToStreamModeAlways()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryUnknownSizeToStreamModeAlways",
writeBigDeflatedEntryToStream(false,
@@ -2424,7 +2424,7 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeBigDeflatedEntryUnknownSizeToStreamModeNever()
+ @Test public void testWriteBigDeflatedEntryUnknownSizeToStreamModeNever()
throws Throwable {
withTemporaryArchive("writeBigDeflatedEntryUnknownSizeToStreamModeNever",
writeBigDeflatedEntryUnknownSizeToStream(Zip64Mode
@@ -2432,20 +2432,20 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeBigStoredEntryKnownSizeToFile() throws Throwable {
+ @Test public void testWriteBigStoredEntryKnownSizeToFile() throws Throwable {
withTemporaryArchive("writeBigStoredEntryKnownSizeToFile",
writeBigStoredEntry(true),
true);
}
- @Test public void writeBigStoredEntryKnownSizeToFileModeAlways()
+ @Test public void testWriteBigStoredEntryKnownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeBigStoredEntryKnownSizeToFileModeAlways",
writeBigStoredEntry(true, Zip64Mode.Always),
true);
}
- @Test public void writeBigStoredEntryKnownSizeToFileModeNever()
+ @Test public void testWriteBigStoredEntryKnownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeBigStoredEntryKnownSizeToFileModeNever",
writeBigStoredEntryModeNever(true),
@@ -2456,59 +2456,59 @@ public class Zip64SupportIT {
* No Compression + Stream => sizes must be known before data is
* written.
*/
- @Test public void writeBigStoredEntryToStream() throws Throwable {
+ @Test public void testWriteBigStoredEntryToStream() throws Throwable {
withTemporaryArchive("writeBigStoredEntryToStream",
writeBigStoredEntry(true),
false);
}
- @Test public void writeBigStoredEntryToStreamModeAlways() throws Throwable {
+ @Test public void testWriteBigStoredEntryToStreamModeAlways() throws Throwable {
withTemporaryArchive("writeBigStoredEntryToStreamModeAlways",
writeBigStoredEntry(true, Zip64Mode.Always),
false);
}
- @Test public void writeBigStoredEntryToStreamModeNever() throws Throwable {
+ @Test public void testWriteBigStoredEntryToStreamModeNever() throws Throwable {
withTemporaryArchive("writeBigStoredEntryToStreamModeNever",
writeBigStoredEntryModeNever(true),
false);
}
- @Test public void writeBigStoredEntryUnknownSizeToFile() throws Throwable {
+ @Test public void testWriteBigStoredEntryUnknownSizeToFile() throws Throwable {
withTemporaryArchive("writeBigStoredEntryUnknownSizeToFile",
writeBigStoredEntry(false),
true);
}
- @Test public void writeBigStoredEntryUnknownSizeToFileModeAlways()
+ @Test public void testWriteBigStoredEntryUnknownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeBigStoredEntryUnknownSizeToFileModeAlways",
writeBigStoredEntry(false, Zip64Mode.Always),
true);
}
- @Test public void writeBigStoredEntryUnknownSizeToFileModeNever()
+ @Test public void testWriteBigStoredEntryUnknownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeBigStoredEntryUnknownSizeToFileModeNever",
writeBigStoredEntryModeNever(false),
true);
}
- @Test public void writeSmallDeflatedEntryKnownSizeToFile()
+ @Test public void testWriteSmallDeflatedEntryKnownSizeToFile()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryKnownSizeToFile",
writeSmallDeflatedEntryToFile(true),
true);
}
- @Test public void writeSmallDeflatedEntryKnownSizeToFileModeAlways()
+ @Test public void testWriteSmallDeflatedEntryKnownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryKnownSizeToFileModeAlways",
writeSmallDeflatedEntryToFileModeAlways(true),
true);
}
- @Test public void writeSmallDeflatedEntryKnownSizeToFileModeNever()
+ @Test public void testWriteSmallDeflatedEntryKnownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryKnownSizeToFileModeNever",
writeSmallDeflatedEntryToFile(true,
@@ -2516,7 +2516,7 @@ public class Zip64SupportIT {
true);
}
- @Test public void writeSmallDeflatedEntryKnownSizeToStream()
+ @Test public void testWriteSmallDeflatedEntryKnownSizeToStream()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryKnownSizeToStream",
writeSmallDeflatedEntryToStream(true,
@@ -2524,14 +2524,14 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeSmallDeflatedEntryKnownSizeToStreamModeAlways()
+ @Test public void testWriteSmallDeflatedEntryKnownSizeToStreamModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryKnownSizeToStreamModeAlways",
writeSmallDeflatedEntryToStreamModeAlways(true),
false);
}
- @Test public void writeSmallDeflatedEntryKnownSizeToStreamModeNever()
+ @Test public void testWriteSmallDeflatedEntryKnownSizeToStreamModeNever()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryKnownSizeToStreamModeNever",
writeSmallDeflatedEntryToStream(true,
@@ -2539,21 +2539,21 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeSmallDeflatedEntryUnknownSizeToFile()
+ @Test public void testWriteSmallDeflatedEntryUnknownSizeToFile()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryUnknownSizeToFile",
writeSmallDeflatedEntryToFile(false),
true);
}
- @Test public void writeSmallDeflatedEntryUnknownSizeToFileModeAlways()
+ @Test public void testWriteSmallDeflatedEntryUnknownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryUnknownSizeToFileModeAlways",
writeSmallDeflatedEntryToFileModeAlways(false),
true);
}
- @Test public void writeSmallDeflatedEntryUnknownSizeToFileModeNever()
+ @Test public void testWriteSmallDeflatedEntryUnknownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryUnknownSizeToFileModeNever",
writeSmallDeflatedEntryToFile(false,
@@ -2561,7 +2561,7 @@ public class Zip64SupportIT {
true);
}
- @Test public void writeSmallDeflatedEntryUnknownSizeToStream()
+ @Test public void testWriteSmallDeflatedEntryUnknownSizeToStream()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryUnknownSizeToStream",
writeSmallDeflatedEntryToStream(false,
@@ -2569,14 +2569,14 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeSmallDeflatedEntryUnknownSizeToStreamModeAlways()
+ @Test public void testWriteSmallDeflatedEntryUnknownSizeToStreamModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryUnknownSizeToStreamModeAlways",
writeSmallDeflatedEntryToStreamModeAlways(false),
false);
}
- @Test public void writeSmallDeflatedEntryUnknownSizeToStreamModeNever()
+ @Test public void testWriteSmallDeflatedEntryUnknownSizeToStreamModeNever()
throws Throwable {
withTemporaryArchive("writeSmallDeflatedEntryUnknownSizeToStreamModeNever",
writeSmallDeflatedEntryToStream(false,
@@ -2584,59 +2584,59 @@ public class Zip64SupportIT {
false);
}
- @Test public void writeSmallStoredEntryKnownSizeToFile() throws Throwable {
+ @Test public void testWriteSmallStoredEntryKnownSizeToFile() throws Throwable {
withTemporaryArchive("writeSmallStoredEntryKnownSizeToFile",
writeSmallStoredEntry(true),
true);
}
- @Test public void writeSmallStoredEntryKnownSizeToFileModeAlways()
+ @Test public void testWriteSmallStoredEntryKnownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallStoredEntryKnownSizeToFileModeAlways",
writeSmallStoredEntryModeAlways(true),
true);
}
- @Test public void writeSmallStoredEntryKnownSizeToFileModeNever()
+ @Test public void testWriteSmallStoredEntryKnownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeSmallStoredEntryKnownSizeToFileModeNever",
writeSmallStoredEntry(true, Zip64Mode.Never),
true);
}
- @Test public void writeSmallStoredEntryToStream() throws Throwable {
+ @Test public void testWriteSmallStoredEntryToStream() throws Throwable {
withTemporaryArchive("writeSmallStoredEntryToStream",
writeSmallStoredEntry(true),
false);
}
- @Test public void writeSmallStoredEntryToStreamModeAlways()
+ @Test public void testWriteSmallStoredEntryToStreamModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallStoredEntryToStreamModeAlways",
writeSmallStoredEntryModeAlways(true),
false);
}
- @Test public void writeSmallStoredEntryToStreamModeNever() throws Throwable {
+ @Test public void testWriteSmallStoredEntryToStreamModeNever() throws Throwable {
withTemporaryArchive("writeSmallStoredEntryToStreamModeNever",
writeSmallStoredEntry(true, Zip64Mode.Never),
false);
}
- @Test public void writeSmallStoredEntryUnknownSizeToFile() throws Throwable {
+ @Test public void testWriteSmallStoredEntryUnknownSizeToFile() throws Throwable {
withTemporaryArchive("writeSmallStoredEntryUnknownSizeToFile",
writeSmallStoredEntry(false),
true);
}
- @Test public void writeSmallStoredEntryUnknownSizeToFileModeAlways()
+ @Test public void testWriteSmallStoredEntryUnknownSizeToFileModeAlways()
throws Throwable {
withTemporaryArchive("writeSmallStoredEntryUnknownSizeToFileModeAlways",
writeSmallStoredEntryModeAlways(false),
true);
}
- @Test public void writeSmallStoredEntryUnknownSizeToFileModeNever()
+ @Test public void testWriteSmallStoredEntryUnknownSizeToFileModeNever()
throws Throwable {
withTemporaryArchive("writeSmallStoredEntryUnknownSizeToFileModeNever",
writeSmallStoredEntry(false, Zip64Mode.Never),
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
index a828a9c3..5c3167cb 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
@@ -53,7 +53,7 @@ public class ZipArchiveEntryTest {
}
@Test
- public void draconicThrowsOnUnparseableExtraData() throws Exception {
+ public void testDraconicThrowsOnUnparseableExtraData() throws Exception {
final ZipExtraField[] extraFields = parsingModeBehaviorTestData();
final ZipArchiveEntry ze = new ZipArchiveEntry("foo");
ze.setExtraFields(extraFields);
@@ -64,7 +64,7 @@ public class ZipArchiveEntryTest {
* @see "https://issues.apache.org/jira/browse/COMPRESS-379"
*/
@Test
- public void isUnixSymlinkIsFalseIfMoreThanOneFlagIsSet() throws Exception {
+ public void testIsUnixSymlinkIsFalseIfMoreThanOneFlagIsSet() throws Exception {
try (ZipFile zf = new ZipFile(getFile("COMPRESS-379.jar"))) {
final ZipArchiveEntry ze = zf.getEntry("META-INF/maven/");
assertFalse(ze.isUnixSymlink());
@@ -72,7 +72,7 @@ public class ZipArchiveEntryTest {
}
@Test
- public void onlyParseableLenientExcludesUnparseableExtraData() throws Exception {
+ public void testOnlyParseableLenientExcludesUnparseableExtraData() throws Exception {
final ZipExtraField[] extraFields = parsingModeBehaviorTestData();
final ZipArchiveEntry ze = new ZipArchiveEntry("foo");
ze.setExtraFields(extraFields);
@@ -81,7 +81,7 @@ public class ZipArchiveEntryTest {
}
@Test
- public void onlyParseableStrictExcludesUnparseableExtraData() throws Exception {
+ public void testOnlyParseableStrictExcludesUnparseableExtraData() throws Exception {
final ZipExtraField[] extraFields = parsingModeBehaviorTestData();
final ZipArchiveEntry ze = new ZipArchiveEntry("foo");
ze.setExtraFields(extraFields);
@@ -105,7 +105,7 @@ public class ZipArchiveEntryTest {
}
@Test
- public void reparsingUnicodeExtraWithUnsupportedversionThrowsInStrictMode()
+ public void testReparsingUnicodeExtraWithUnsupportedversionThrowsInStrictMode()
throws Exception {
try (ZipFile zf = new ZipFile(getFile("COMPRESS-479.zip"))) {
final ZipArchiveEntry ze = zf.getEntry("%U20AC_for_Dollar.txt");
@@ -114,7 +114,7 @@ public class ZipArchiveEntryTest {
}
@Test
- public void strictForKnowExtraFieldsIncludesUnparseableExtraData() throws Exception {
+ public void testStrictForKnowExtraFieldsIncludesUnparseableExtraData() throws Exception {
final ZipExtraField[] extraFields = parsingModeBehaviorTestData();
final ZipArchiveEntry ze = new ZipArchiveEntry("foo");
ze.setExtraFields(extraFields);
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
index 4a8aad88..3754d4d0 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
@@ -155,37 +155,37 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("bzip2-zip.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("bla.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-380/COMPRESS-380.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("imploding-8Kdict-3trees.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-264.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("SHRUNK.ZIP"));
}
@Test
- public void multiByteReadThrowsAtEofForCorruptedStoredEntry() throws Exception {
+ public void testMultiByteReadThrowsAtEofForCorruptedStoredEntry() throws Exception {
final byte[] content = Files.readAllBytes(getFile("COMPRESS-264.zip").toPath());
// make size much bigger than entry's real size
for (int i = 17; i < 26; i++) {
@@ -205,24 +205,24 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void nameSourceDefaultsToName() throws Exception {
+ public void testNameSourceDefaultsToName() throws Exception {
nameSource("bla.zip", "test1.xml", ZipArchiveEntry.NameSource.NAME);
}
@Test
- public void nameSourceIsSetToEFS() throws Exception {
+ public void testNameSourceIsSetToEFS() throws Exception {
nameSource("utf8-7zip-test.zip", "\u20AC_for_Dollar.txt", 3,
ZipArchiveEntry.NameSource.NAME_WITH_EFS_FLAG);
}
@Test
- public void nameSourceIsSetToUnicodeExtraField() throws Exception {
+ public void testNameSourceIsSetToUnicodeExtraField() throws Exception {
nameSource("utf8-winzip-test.zip", "\u20AC_for_Dollar.txt",
ZipArchiveEntry.NameSource.UNICODE_EXTRA_FIELD);
}
@Test
- public void properlyMarksEntriesAsUnreadableIfUncompressedSizeIsUnknown() throws Exception {
+ public void testProperlyMarksEntriesAsUnreadableIfUncompressedSizeIsUnknown() throws Exception {
// we never read any data
try (ZipArchiveInputStream zis = new ZipArchiveInputStream(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY))) {
final ZipArchiveEntry e = new ZipArchiveEntry("test");
@@ -236,7 +236,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void properlyReadsStoredEntries() throws IOException {
+ public void testProperlyReadsStoredEntries() throws IOException {
try (InputStream fs = newInputStream("bla-stored.zip");
ZipArchiveInputStream archive = new ZipArchiveInputStream(fs)) {
ZipArchiveEntry e = archive.getNextZipEntry();
@@ -258,7 +258,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void properlyReadsStoredEntryWithDataDescriptorWithoutSignature() throws IOException {
+ public void testProperlyReadsStoredEntryWithDataDescriptorWithoutSignature() throws IOException {
try (InputStream fs = newInputStream("bla-stored-dd-nosig.zip");
ZipArchiveInputStream archive = new ZipArchiveInputStream(fs, "UTF-8", true, true)) {
final ZipArchiveEntry e = archive.getNextZipEntry();
@@ -274,7 +274,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void properlyReadsStoredEntryWithDataDescriptorWithSignature() throws IOException {
+ public void testProperlyReadsStoredEntryWithDataDescriptorWithSignature() throws IOException {
try (InputStream fs = newInputStream("bla-stored-dd.zip");
ZipArchiveInputStream archive = new ZipArchiveInputStream(fs, "UTF-8", true, true)) {
final ZipArchiveEntry e = archive.getNextZipEntry();
@@ -293,7 +293,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-189"
*/
@Test
- public void properUseOfInflater() throws Exception {
+ public void testProperUseOfInflater() throws Exception {
ZipFile zf = null;
ZipArchiveInputStream in = null;
try {
@@ -320,7 +320,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-380"
*/
@Test
- public void readDeflate64CompressedStream() throws Exception {
+ public void testReadDeflate64CompressedStream() throws Exception {
final File input = getFile("COMPRESS-380/COMPRESS-380-input");
final File archive = getFile("COMPRESS-380/COMPRESS-380.zip");
try (InputStream in = Files.newInputStream(input.toPath());
@@ -333,7 +333,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void readDeflate64CompressedStreamWithDataDescriptor() throws Exception {
+ public void testReadDeflate64CompressedStreamWithDataDescriptor() throws Exception {
// this is a copy of bla.jar with META-INF/MANIFEST.MF's method manually changed to ENHANCED_DEFLATED
final File archive = getFile("COMPRESS-380/COMPRESS-380-dd.zip");
try (ZipArchiveInputStream zin = new ZipArchiveInputStream(Files.newInputStream(archive.toPath()))) {
@@ -352,7 +352,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsStoredEntriesWithDataDescriptorByDefault() throws IOException {
+ public void testRejectsStoredEntriesWithDataDescriptorByDefault() throws IOException {
try (InputStream fs = newInputStream("bla-stored-dd.zip"); ZipArchiveInputStream archive = new ZipArchiveInputStream(fs)) {
final ZipArchiveEntry e = archive.getNextZipEntry();
assertNotNull(e);
@@ -364,7 +364,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldConsumeArchiveCompletely() throws Exception {
+ public void testShouldConsumeArchiveCompletely() throws Exception {
try (InputStream is = ZipArchiveInputStreamTest.class.getResourceAsStream("/archive_with_trailer.zip");
ZipArchiveInputStream zip = new ZipArchiveInputStream(is)) {
getAllZipEntries(zip);
@@ -379,7 +379,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-219"
*/
@Test
- public void shouldReadNestedZip() throws IOException {
+ public void testShouldReadNestedZip() throws IOException {
try (ZipArchiveInputStream in = new ZipArchiveInputStream(newInputStream("COMPRESS-219.zip"))) {
extractZipInputStream(in);
}
@@ -396,37 +396,37 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("bzip2-zip.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("bla.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-380/COMPRESS-380.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("imploding-8Kdict-3trees.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-264.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("SHRUNK.ZIP"));
}
@Test
- public void singleByteReadThrowsAtEofForCorruptedStoredEntry() throws Exception {
+ public void testSingleByteReadThrowsAtEofForCorruptedStoredEntry() throws Exception {
final byte[] content = Files.readAllBytes(getFile("COMPRESS-264.zip").toPath());
// make size much bigger than entry's real size
for (int i = 17; i < 26; i++) {
@@ -736,7 +736,7 @@ public class ZipArchiveInputStreamTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-176"
*/
@Test
- public void winzipBackSlashWorkaround() throws Exception {
+ public void testWinzipBackSlashWorkaround() throws Exception {
try (ZipArchiveInputStream in = new ZipArchiveInputStream(newInputStream("test-winzip.zip"))) {
ZipArchiveEntry zae = in.getNextZipEntry();
zae = in.getNextZipEntry();
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileIgnoringLocalFileHeaderTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileIgnoringLocalFileHeaderTest.java
index a6330fbe..a21cdcd7 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileIgnoringLocalFileHeaderTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileIgnoringLocalFileHeaderTest.java
@@ -40,7 +40,7 @@ public class ZipFileIgnoringLocalFileHeaderTest {
private File dir;
@Test
- public void getEntryWorks() throws IOException {
+ public void testGetEntryWorks() throws IOException {
try (final ZipFile zf = openZipWithoutLFH("bla.zip")) {
final ZipArchiveEntry ze = zf.getEntry("test1.xml");
assertEquals(610, ze.getSize());
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
index 0a5e694e..b61a86fb 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
@@ -162,7 +162,7 @@ public class ZipFileTest extends AbstractTestCase {
}
@Test
- public void extractFileLiesAcrossSplitZipSegmentsCreatedByWinrar() throws Exception {
+ public void testExtractFileLiesAcrossSplitZipSegmentsCreatedByWinrar() throws Exception {
final File lastFile = getFile("COMPRESS-477/split_zip_created_by_winrar/split_zip_created_by_winrar.zip");
try (final SeekableByteChannel channel = ZipSplitReadOnlySeekableByteChannel.buildFromLastSplitSegment(lastFile)) {
zf = new ZipFile(channel);
@@ -175,7 +175,7 @@ public class ZipFileTest extends AbstractTestCase {
}
@Test
- public void extractFileLiesAcrossSplitZipSegmentsCreatedByZip() throws Exception {
+ public void testExtractFileLiesAcrossSplitZipSegmentsCreatedByZip() throws Exception {
final File lastFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.zip");
try (final SeekableByteChannel channel = ZipSplitReadOnlySeekableByteChannel.buildFromLastSplitSegment(lastFile)) {
zf = new ZipFile(channel);
@@ -194,7 +194,7 @@ public class ZipFileTest extends AbstractTestCase {
}
@Test
- public void extractFileLiesAcrossSplitZipSegmentsCreatedByZipOfZip64() throws Exception {
+ public void testExtractFileLiesAcrossSplitZipSegmentsCreatedByZipOfZip64() throws Exception {
final File lastFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip_zip64.zip");
try (final SeekableByteChannel channel = ZipSplitReadOnlySeekableByteChannel.buildFromLastSplitSegment(lastFile)) {
zf = new ZipFile(channel);
@@ -225,48 +225,48 @@ public class ZipFileTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("bzip2-zip.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("bla.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-380/COMPRESS-380.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("imploding-8Kdict-3trees.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-264.zip"));
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(getFile("SHRUNK.ZIP"));
}
@Test
- public void nameSourceDefaultsToName() throws Exception {
+ public void testNameSourceDefaultsToName() throws Exception {
nameSource("bla.zip", "test1.xml", ZipArchiveEntry.NameSource.NAME);
}
@Test
- public void nameSourceIsSetToEFS() throws Exception {
+ public void testNameSourceIsSetToEFS() throws Exception {
nameSource("utf8-7zip-test.zip", "\u20AC_for_Dollar.txt",
ZipArchiveEntry.NameSource.NAME_WITH_EFS_FLAG);
}
@Test
- public void nameSourceIsSetToUnicodeExtraField() throws Exception {
+ public void testNameSourceIsSetToUnicodeExtraField() throws Exception {
nameSource("utf8-winzip-test.zip", "\u20AC_for_Dollar.txt",
ZipArchiveEntry.NameSource.UNICODE_EXTRA_FIELD);
}
@@ -275,7 +275,7 @@ public class ZipFileTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-380"
*/
@Test
- public void readDeflate64CompressedStream() throws Exception {
+ public void testReadDeflate64CompressedStream() throws Exception {
final File input = getFile("COMPRESS-380/COMPRESS-380-input");
final File archive = getFile("COMPRESS-380/COMPRESS-380.zip");
try (InputStream in = Files.newInputStream(input.toPath());
@@ -327,32 +327,32 @@ public class ZipFileTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingBzip2() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("bzip2-zip.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("bla.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingDeflate64() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-380/COMPRESS-380.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingExplode() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("imploding-8Kdict-3trees.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingStore() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("COMPRESS-264.zip"));
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofUsingUnshrink() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(getFile("SHRUNK.ZIP"));
}
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipMemoryFileSystemTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipMemoryFileSystemTest.java
index c5e7ab3c..8c81d367 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipMemoryFileSystemTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipMemoryFileSystemTest.java
@@ -71,7 +71,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void forPathsReturnCorrectClassInMemory() throws IOException {
+ public void testForPathsReturnCorrectClassInMemory() throws IOException {
final Path firstFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
final Path secondFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z02");
final Path lastFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.zip");
@@ -97,7 +97,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void positionToSomeZipSplitSegmentInMemory() throws IOException {
+ public void testPositionToSomeZipSplitSegmentInMemory() throws IOException {
final Path firstFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
final Path secondFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z02");
final Path lastFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.zip");
@@ -132,7 +132,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void scatterFileInMemory() throws IOException {
+ public void testScatterFileInMemory() throws IOException {
final byte[] B_PAYLOAD = "RBBBBBBS".getBytes();
final byte[] A_PAYLOAD = "XAAY".getBytes();
final Path target = Files.createTempFile(dir, "scattertest", ".zip");
@@ -174,7 +174,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void scatterFileWithCompressionAndTargetInMemory() throws IOException {
+ public void testScatterFileWithCompressionAndTargetInMemory() throws IOException {
final byte[] B_PAYLOAD = "RBBBBBBS".getBytes();
final byte[] A_PAYLOAD = "XAAY".getBytes();
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
@@ -215,7 +215,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void scatterFileWithCompressionInMemory() throws IOException {
+ public void testScatterFileWithCompressionInMemory() throws IOException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path scatterFile = fileSystem.getPath("scattertest.notzip");
final Path target = Files.createTempFile(dir, "scattertest", ".zip");
@@ -273,7 +273,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipFileInMemory() throws IOException {
+ public void testZipFileInMemory() throws IOException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path scatterFile = fileSystem.getPath("scattertest.notzip");
final Path target = fileSystem.getPath("scattertest.zip");
@@ -313,7 +313,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipFromMemoryFileSystemFile() throws IOException, NoSuchAlgorithmException {
+ public void testZipFromMemoryFileSystemFile() throws IOException, NoSuchAlgorithmException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path textFileInMemSys = fileSystem.getPath("test.txt");
final byte[] bytes = new byte[100 * 1024];
@@ -335,7 +335,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipFromMemoryFileSystemOutputStream() throws IOException, ArchiveException {
+ public void testZipFromMemoryFileSystemOutputStream() throws IOException, ArchiveException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path p = fileSystem.getPath("test.txt");
Files.write(p, "Test".getBytes(UTF_8));
@@ -355,7 +355,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipFromMemoryFileSystemPath() throws IOException, NoSuchAlgorithmException {
+ public void testZipFromMemoryFileSystemPath() throws IOException, NoSuchAlgorithmException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path textFileInMemSys = fileSystem.getPath("test.txt");
final byte[] bytes = new byte[100 * 1024];
@@ -377,7 +377,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipFromMemoryFileSystemSeekableByteChannel() throws IOException, NoSuchAlgorithmException {
+ public void testZipFromMemoryFileSystemSeekableByteChannel() throws IOException, NoSuchAlgorithmException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path textFileInMemSys = fileSystem.getPath("test.txt");
final byte[] bytes = new byte[100 * 1024];
@@ -401,7 +401,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipFromMemoryFileSystemSplitFile() throws IOException, NoSuchAlgorithmException {
+ public void testZipFromMemoryFileSystemSplitFile() throws IOException, NoSuchAlgorithmException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path textFileInMemSys = fileSystem.getPath("test.txt");
final byte[] bytes = new byte[100 * 1024];
@@ -429,7 +429,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipToMemoryFileSystemOutputStream() throws IOException, ArchiveException {
+ public void testZipToMemoryFileSystemOutputStream() throws IOException, ArchiveException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path p = fileSystem.getPath("target.zip");
@@ -450,7 +450,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipToMemoryFileSystemPath() throws IOException {
+ public void testZipToMemoryFileSystemPath() throws IOException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path zipInMemSys = fileSystem.getPath("target.zip");
@@ -470,7 +470,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipToMemoryFileSystemSeekableByteChannel() throws IOException {
+ public void testZipToMemoryFileSystemSeekableByteChannel() throws IOException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path zipInMemSys = fileSystem.getPath("target.zip");
@@ -492,7 +492,7 @@ public class ZipMemoryFileSystemTest {
}
@Test
- public void zipToMemoryFileSystemSplitPath() throws IOException, NoSuchAlgorithmException {
+ public void testZipToMemoryFileSystemSplitPath() throws IOException, NoSuchAlgorithmException {
try (FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build()) {
final Path zipInMemSys = fileSystem.getPath("target.zip");
final byte[] bytes = new byte[100 * 1024];
diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipSplitOutputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipSplitOutputStreamTest.java
index 51fc8987..24a3a293 100644
--- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipSplitOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipSplitOutputStreamTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
public class ZipSplitOutputStreamTest extends AbstractTestCase {
@Test
- public void splitZipBeginsWithZipSplitSignature() throws IOException {
+ public void testSplitZipBeginsWithZipSplitSignature() throws IOException {
final File tempFile = File.createTempFile("temp", "zip");
new ZipSplitOutputStream(tempFile, 100 * 1024L);
diff --git a/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java b/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
index 21527a9f..92e00206 100644
--- a/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
+++ b/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
@@ -44,7 +44,7 @@ import org.junit.jupiter.params.provider.ValueSource;
public final class GZipTestCase extends AbstractTestCase {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tgz");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -56,7 +56,7 @@ public final class GZipTestCase extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tgz");
try (InputStream is = Files.newInputStream(input.toPath());
final GzipCompressorInputStream in = new GzipCompressorInputStream(is)) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/LZMATestCase.java b/src/test/java/org/apache/commons/compress/compressors/LZMATestCase.java
index c16f6d7f..9356bdf9 100644
--- a/src/test/java/org/apache/commons/compress/compressors/LZMATestCase.java
+++ b/src/test/java/org/apache/commons/compress/compressors/LZMATestCase.java
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
public final class LZMATestCase extends AbstractTestCase {
@Test
- public void lzmaRoundtrip() throws Exception {
+ public void testLzmaRoundtrip() throws Exception {
final File input = getFile("test1.xml");
final File compressed = new File(dir, "test1.xml.xz");
try (OutputStream out = Files.newOutputStream(compressed.toPath())) {
@@ -53,7 +53,7 @@ public final class LZMATestCase extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.lzma");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath())) {
@@ -66,7 +66,7 @@ public final class LZMATestCase extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.lzma");
try (InputStream is = Files.newInputStream(input.toPath())) {
try (LZMACompressorInputStream in = new LZMACompressorInputStream(is)) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/Pack200TestCase.java b/src/test/java/org/apache/commons/compress/compressors/Pack200TestCase.java
index 80307f80..a9e21169 100644
--- a/src/test/java/org/apache/commons/compress/compressors/Pack200TestCase.java
+++ b/src/test/java/org/apache/commons/compress/compressors/Pack200TestCase.java
@@ -106,12 +106,12 @@ public final class Pack200TestCase extends AbstractTestCase {
}
@Test
- public void multiByteReadFromMemoryConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadFromMemoryConsistentlyReturnsMinusOneAtEof() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(Pack200Strategy.IN_MEMORY);
}
@Test
- public void multiByteReadFromTempFileConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadFromTempFileConsistentlyReturnsMinusOneAtEof() throws Exception {
multiByteReadConsistentlyReturnsMinusOneAtEof(Pack200Strategy.TEMP_FILE);
}
@@ -125,12 +125,12 @@ public final class Pack200TestCase extends AbstractTestCase {
}
@Test
- public void singleByteReadFromMemoryConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadFromMemoryConsistentlyReturnsMinusOneAtEof() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(Pack200Strategy.IN_MEMORY);
}
@Test
- public void singleByteReadFromTempFileConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadFromTempFileConsistentlyReturnsMinusOneAtEof() throws Exception {
singleByteReadConsistentlyReturnsMinusOneAtEof(Pack200Strategy.TEMP_FILE);
}
diff --git a/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
index 1cb4dd6f..d480be0f 100644
--- a/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/brotli/BrotliCompressorInputStreamTest.java
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
public class BrotliCompressorInputStreamTest extends AbstractTestCase {
@Test
- public void availableShouldReturnZero() throws IOException {
+ public void testAvailableShouldReturnZero() throws IOException {
try (InputStream is = newInputStream("brotli.testdata.compressed");
final BrotliCompressorInputStream in = new BrotliCompressorInputStream(is)) {
assertEquals(0, in.available());
@@ -44,7 +44,7 @@ public class BrotliCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final byte[] buf = new byte[2];
try (InputStream is = newInputStream("brotli.testdata.compressed");
final BrotliCompressorInputStream in = new BrotliCompressorInputStream(is)) {
@@ -55,7 +55,7 @@ public class BrotliCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldBeAbleToSkipAByte() throws IOException {
+ public void testShouldBeAbleToSkipAByte() throws IOException {
try (InputStream is = newInputStream("brotli.testdata.compressed");
final BrotliCompressorInputStream in = new BrotliCompressorInputStream(is)) {
assertEquals(1, in.skip(1));
@@ -63,7 +63,7 @@ public class BrotliCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
try (InputStream is = newInputStream("brotli.testdata.compressed");
final BrotliCompressorInputStream in = new BrotliCompressorInputStream(is)) {
IOUtils.toByteArray(in);
@@ -73,7 +73,7 @@ public class BrotliCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadWorksAsExpected() throws IOException {
+ public void testSingleByteReadWorksAsExpected() throws IOException {
try (InputStream is = newInputStream("brotli.testdata.compressed");
final BrotliCompressorInputStream in = new BrotliCompressorInputStream(is)) {
// starts with file name "XXX"
diff --git a/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStreamTest.java
index 7ad1511b..1aa9e75b 100644
--- a/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStreamTest.java
@@ -50,7 +50,7 @@ public class BZip2CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.txt.bz2");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -65,7 +65,7 @@ public class BZip2CompressorInputStreamTest extends AbstractTestCase {
* @see "https://issues.apache.org/jira/browse/COMPRESS-309"
*/
@Test
- public void readOfLength0ShouldReturn0() throws Exception {
+ public void testReadOfLength0ShouldReturn0() throws Exception {
// Create a big random piece of data
final byte[] rawData = new byte[1048576];
for (int i = 0; i < rawData.length; ++i) {
@@ -92,7 +92,7 @@ public class BZip2CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldThrowAnIOExceptionWhenAppliedToAZipFile() throws Exception {
+ public void testShouldThrowAnIOExceptionWhenAppliedToAZipFile() throws Exception {
try (InputStream in = newInputStream("bla.zip")) {
assertThrows(IOException.class, () -> new BZip2CompressorInputStream(in));
}
@@ -102,7 +102,7 @@ public class BZip2CompressorInputStreamTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-516">COMPRESS-516</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS516() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS516() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x2e, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x84, 0xb6, 0xba, 0x46, 0x72, 0xb6, 0xfe, 0x77, 0x63, 0x00,
@@ -127,7 +127,7 @@ public class BZip2CompressorInputStreamTest extends AbstractTestCase {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-519">COMPRESS-519</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS519() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS519() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x2e, 0x00, 0x00, 0x00, 0x0c, 0x00,
0x84, 0xb6, 0xba, 0x46, 0x72, 0xb6, 0xfe, 0x77, 0x63, 0x00,
@@ -145,7 +145,7 @@ public class BZip2CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.txt.bz2");
try (InputStream is = Files.newInputStream(input.toPath());
final BZip2CompressorInputStream in = new BZip2CompressorInputStream(is)) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2NSelectorsOverflowTest.java b/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2NSelectorsOverflowTest.java
index 8b3e923e..e928fcf0 100644
--- a/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2NSelectorsOverflowTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2NSelectorsOverflowTest.java
@@ -33,7 +33,7 @@ public class BZip2NSelectorsOverflowTest extends AbstractTestCase {
* See https://sourceware.org/ml/bzip2-devel/2019-q3/msg00007.html
*/
@Test
- public void shouldDecompressBlockWithNSelectorOverflow() throws Exception {
+ public void testShouldDecompressBlockWithNSelectorOverflow() throws Exception {
final File toDecompress = getFile("lbzip2_32767.bz2");
try (final InputStream is = Files.newInputStream(toDecompress.toPath());
final BZip2CompressorInputStream in = new BZip2CompressorInputStream(is)) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStreamTest.java
index df79371a..a5e38308 100644
--- a/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStreamTest.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
public class DeflateCompressorInputStreamTest {
@Test
- public void availableShouldReturnNonZero() throws IOException {
+ public void testAvailableShouldReturnNonZero() throws IOException {
try (InputStream is = Files.newInputStream(AbstractTestCase.getPath("bla.tar.deflatez"));
DeflateCompressorInputStream in = new DeflateCompressorInputStream(is)) {
assertTrue(in.available() > 0);
@@ -40,7 +40,7 @@ public class DeflateCompressorInputStreamTest {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(AbstractTestCase.getPath("bla.tar.deflatez"));
DeflateCompressorInputStream in = new DeflateCompressorInputStream(is)) {
@@ -51,7 +51,7 @@ public class DeflateCompressorInputStreamTest {
}
@Test
- public void shouldBeAbleToSkipAByte() throws IOException {
+ public void testShouldBeAbleToSkipAByte() throws IOException {
try (InputStream is = Files.newInputStream(AbstractTestCase.getPath("bla.tar.deflatez"));
DeflateCompressorInputStream in = new DeflateCompressorInputStream(is)) {
assertEquals(1, in.skip(1));
@@ -59,7 +59,7 @@ public class DeflateCompressorInputStreamTest {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
try (InputStream is = Files.newInputStream(AbstractTestCase.getPath("bla.tar.deflatez"));
DeflateCompressorInputStream in = new DeflateCompressorInputStream(is)) {
IOUtils.toByteArray(in);
@@ -69,7 +69,7 @@ public class DeflateCompressorInputStreamTest {
}
@Test
- public void singleByteReadWorksAsExpected() throws IOException {
+ public void testSingleByteReadWorksAsExpected() throws IOException {
try (InputStream is = Files.newInputStream(AbstractTestCase.getPath("bla.tar.deflatez"));
DeflateCompressorInputStream in = new DeflateCompressorInputStream(is)) {
// tar header starts with file name "test1.xml"
diff --git a/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStreamTest.java
index fdc91992..f69a50fc 100644
--- a/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStreamTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
public class DeflateCompressorOutputStreamTest {
@Test
- public void canReadASingleByteFlushAndFinish() throws IOException {
+ public void testCanReadASingleByteFlushAndFinish() throws IOException {
try (final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final DeflateCompressorOutputStream cos = new DeflateCompressorOutputStream(bos)) {
cos.write(99);
diff --git a/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateParametersTest.java b/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateParametersTest.java
index f6fba9d6..75dde596 100644
--- a/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateParametersTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/deflate/DeflateParametersTest.java
@@ -26,20 +26,20 @@ import org.junit.jupiter.api.Test;
public class DeflateParametersTest {
@Test
- public void shouldBeAbleToSetCompressionLevel() {
+ public void testShouldBeAbleToSetCompressionLevel() {
final DeflateParameters p = new DeflateParameters();
p.setCompressionLevel(5);
assertEquals(5, p.getCompressionLevel());
}
@Test
- public void shouldNotBeAbleToSetCompressionLevelToADoubleDigitValue() {
+ public void testShouldNotBeAbleToSetCompressionLevelToADoubleDigitValue() {
final DeflateParameters p = new DeflateParameters();
assertThrows(IllegalArgumentException.class, () -> p.setCompressionLevel(DeflateParameters.MAX_LEVEL + 1));
}
@Test
- public void shouldNotBeAbleToSetCompressionLevelToANegativeValue() {
+ public void testShouldNotBeAbleToSetCompressionLevelToANegativeValue() {
final DeflateParameters p = new DeflateParameters();
assertThrows(IllegalArgumentException.class, () -> p.setCompressionLevel(DeflateParameters.MIN_LEVEL - 1));
}
diff --git a/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64BugsTest.java b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64BugsTest.java
index 9a570e04..0200be2e 100644
--- a/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64BugsTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64BugsTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
public class Deflate64BugsTest {
@Test
- public void readBeyondMemoryException() throws Exception {
+ public void testReadBeyondMemoryException() throws Exception {
try (ZipFile zfile = new ZipFile(getFile("COMPRESS-380/COMPRESS-380-readbeyondmemory.zip"))) {
final Enumeration<ZipArchiveEntry> entries = zfile.getEntries();
while (entries.hasMoreElements()) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
index 1a4e1338..810b91d2 100644
--- a/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/deflate64/Deflate64CompressorInputStreamTest.java
@@ -47,7 +47,7 @@ public class Deflate64CompressorInputStreamTest {
private HuffmanDecoder decoder;
@Test
- public void closeCallsDecoder() throws Exception {
+ public void testCloseCallsDecoder() throws Exception {
try (final Deflate64CompressorInputStream input = new Deflate64CompressorInputStream(decoder)) {
// empty
@@ -57,7 +57,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void closeIsDelegatedJustOnce() throws Exception {
+ public void testCloseIsDelegatedJustOnce() throws Exception {
try (final Deflate64CompressorInputStream input = new Deflate64CompressorInputStream(decoder)) {
input.close();
@@ -67,7 +67,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void delegatesAvailable() throws Exception {
+ public void testDelegatesAvailable() throws Exception {
Mockito.when(decoder.available()).thenReturn(1024);
try (final Deflate64CompressorInputStream input = new Deflate64CompressorInputStream(decoder)) {
@@ -88,7 +88,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
final byte[] buf = new byte[2];
try (final Deflate64CompressorInputStream in =
new Deflate64CompressorInputStream(nullDecoder)) {
@@ -99,14 +99,14 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void properSizeWhenClosed() throws Exception {
+ public void testProperSizeWhenClosed() throws Exception {
try (final Deflate64CompressorInputStream input = new Deflate64CompressorInputStream(nullDecoder)) {
assertEquals(0, input.available());
}
}
@Test
- public void readWhenClosed() throws Exception {
+ public void testReadWhenClosed() throws Exception {
try (final Deflate64CompressorInputStream input = new Deflate64CompressorInputStream(nullDecoder)) {
assertEquals(-1, input.read());
assertEquals(-1, input.read(new byte[1]));
@@ -118,7 +118,7 @@ public class Deflate64CompressorInputStreamTest {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-521">COMPRESS-521</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS521() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS521() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x2e, 0x00, 0xb6, 0x00, 0x09, 0x00,
0x84, 0xb6, 0xba, 0x46, 0x72, 0x00, 0xfe, 0x77, 0x63, 0x00,
@@ -134,7 +134,7 @@ public class Deflate64CompressorInputStreamTest {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-522">COMPRESS-522</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS522() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS522() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x00, 0x09, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -147,7 +147,7 @@ public class Deflate64CompressorInputStreamTest {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-525">COMPRESS-525</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS525() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS525() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x00, 0x09, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -172,7 +172,7 @@ public class Deflate64CompressorInputStreamTest {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-526">COMPRESS-526</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS526() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS526() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x00, 0x09, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -199,7 +199,7 @@ public class Deflate64CompressorInputStreamTest {
* @see <a href="https://issues.apache.org/jira/browse/COMPRESS-527">COMPRESS-527</a>
*/
@Test
- public void shouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS527() {
+ public void testShouldThrowIOExceptionInsteadOfRuntimeExceptionCOMPRESS527() {
assertThrows(IOException.class, () -> fuzzingTest(new int[] {
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x00, 0x09, 0x00,
0x84, 0xb6, 0xba, 0x46, 0x72, 0xb6, 0xfe, 0x77, 0x4a, 0x00,
@@ -214,7 +214,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void shouldThrowsEOFExceptionOnTruncatedStreams() throws IOException {
+ public void testShouldThrowsEOFExceptionOnTruncatedStreams() throws IOException {
final byte[] data = {
1, 11, 0, -12, -1,
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l',
@@ -227,7 +227,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws Exception {
try (final Deflate64CompressorInputStream in =
new Deflate64CompressorInputStream(nullDecoder)) {
IOUtils.toByteArray(in);
@@ -237,7 +237,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void streamIgnoresExtraBytesAfterDeflatedInput() throws Exception {
+ public void testStreamIgnoresExtraBytesAfterDeflatedInput() throws Exception {
final byte[] data = {
1, 11, 0, -12, -1,
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', 'X'
@@ -251,7 +251,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void uncompressedBlock() throws Exception {
+ public void testUncompressedBlock() throws Exception {
final byte[] data = {
1, 11, 0, -12, -1,
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'
@@ -265,7 +265,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void uncompressedBlockAvailable() throws Exception {
+ public void testUncompressedBlockAvailable() throws Exception {
final byte[] data = {
1, 11, 0, -12, -1,
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'
@@ -278,7 +278,7 @@ public class Deflate64CompressorInputStreamTest {
}
@Test
- public void uncompressedBlockViaFactory() throws Exception {
+ public void testUncompressedBlockViaFactory() throws Exception {
final byte[] data = {
1, 11, 0, -12, -1,
'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'
diff --git a/src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java b/src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java
index fa6fbcd7..1edabe1a 100644
--- a/src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoderTest.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
public class HuffmanDecoderTest {
@Test
- public void decodeFixedHuffmanBlockWithMemoryLookup() throws Exception {
+ public void testDecodeFixedHuffmanBlockWithMemoryLookup() throws Exception {
final byte[] data = {
//|--- binary filling ---|76543210
0b11111111111111111111111111110011, // final block + fixed huffman + H
@@ -57,7 +57,7 @@ public class HuffmanDecoderTest {
}
@Test
- public void decodeFixedHuffmanBlockWithMemoryLookupInExactBuffer() throws Exception {
+ public void testDecodeFixedHuffmanBlockWithMemoryLookupInExactBuffer() throws Exception {
final byte[] data = {
//|--- binary filling ---|76543210
0b11111111111111111111111111110011, // final block + fixed huffman + H
@@ -91,7 +91,7 @@ public class HuffmanDecoderTest {
}
@Test
- public void decodeFixedHuffmanBlockWithMemoryLookupInSmallBuffer() throws Exception {
+ public void testDecodeFixedHuffmanBlockWithMemoryLookupInSmallBuffer() throws Exception {
final byte[] data = {
//|--- binary filling ---|76543210
0b11111111111111111111111111110011, // final block + fixed huffman + H
@@ -126,7 +126,7 @@ public class HuffmanDecoderTest {
}
@Test
- public void decodeSimpleFixedHuffmanBlock() throws Exception {
+ public void testDecodeSimpleFixedHuffmanBlock() throws Exception {
final byte[] data = {
//|--- binary filling ---|76543210
0b11111111111111111111111111110011, // final block + fixed huffman + H
@@ -154,7 +154,7 @@ public class HuffmanDecoderTest {
@Test
- public void decodeSimpleFixedHuffmanBlockToSmallBuffer() throws Exception {
+ public void testDecodeSimpleFixedHuffmanBlockToSmallBuffer() throws Exception {
final byte[] data = {
//|--- binary filling ---|76543210
0b11111111111111111111111111110011, // final block + fixed huffman + H
@@ -184,7 +184,7 @@ public class HuffmanDecoderTest {
}
@Test
- public void decodeUncompressedBlock() throws Exception {
+ public void testDecodeUncompressedBlock() throws Exception {
final byte[] data = {
0b1, // end of block + no compression mode
11, 0, -12, -1, // len & ~len
@@ -200,7 +200,7 @@ public class HuffmanDecoderTest {
}
@Test
- public void decodeUncompressedBlockWithInvalidLenNLenValue() throws Exception {
+ public void testDecodeUncompressedBlockWithInvalidLenNLenValue() throws Exception {
final byte[] data = {
0b1, // end of block + no compression mode
11, 0, -12, -2, // len & ~len
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStreamTest.java
index a404edf1..5a9a5f44 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStreamTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
public class BlockLZ4CompressorInputStreamTest extends AbstractTestCase {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.block_lz4");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -45,7 +45,7 @@ public class BlockLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaLz4() throws IOException {
+ public void testReadBlaLz4() throws IOException {
try (InputStream a = new BlockLZ4CompressorInputStream(newInputStream("bla.tar.block_lz4"));
InputStream e = newInputStream("bla.tar")) {
final byte[] expected = IOUtils.toByteArray(e);
@@ -55,7 +55,7 @@ public class BlockLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.block_lz4");
try (InputStream is = Files.newInputStream(input.toPath());
BlockLZ4CompressorInputStream in = new BlockLZ4CompressorInputStream(is)) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStreamTest.java
index 873dc29d..a49534c3 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStreamTest.java
@@ -34,21 +34,21 @@ import org.junit.jupiter.api.Test;
public class BlockLZ4CompressorOutputStreamTest {
@Test
- public void cantWriteBackReferenceFollowedByLiteralThatIsTooShort() {
+ public void testCantWriteBackReferenceFollowedByLiteralThatIsTooShort() {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(10, 14));
assertFalse(p.canBeWritten(4));
}
@Test
- public void cantWriteBackReferenceIfAccumulatedOffsetIsTooShort() {
+ public void testCantWriteBackReferenceIfAccumulatedOffsetIsTooShort() {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 4));
assertFalse(p.canBeWritten(5));
}
@Test
- public void canWriteBackReferenceFollowedByLongLiteral() {
+ public void testCanWriteBackReferenceFollowedByLongLiteral() {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 4));
// a length of 11 would be enough according to the spec, but
@@ -74,7 +74,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void canWritePairWithoutBackReference() throws IOException {
+ public void testCanWritePairWithoutBackReference() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
final byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
p.addLiteral(new LZ77Compressor.LiteralBlock(b, 1, 4));
@@ -84,7 +84,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void canWritePairWithoutLiterals() throws IOException {
+ public void testCanWritePairWithoutLiterals() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 4));
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -117,7 +117,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void pairAccumulatesLengths() {
+ public void testPairAccumulatesLengths() {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 4));
final byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
@@ -127,7 +127,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void pairSeesBackReferenceWhenSet() {
+ public void testPairSeesBackReferenceWhenSet() {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
assertFalse(p.hasBackReference());
p.setBackReference(new LZ77Compressor.BackReference(1, 4));
@@ -141,7 +141,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void rewritingOfFinalBlockWithoutTrailingLZ77Literals() throws IOException {
+ public void testRewritingOfFinalBlockWithoutTrailingLZ77Literals() throws IOException {
for (int i = 1; i < 13; i++) {
// according to the spec these are all too short be compressed
// LZ77Compressor will create a single byte literal
@@ -190,7 +190,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void rewritingOfFinalBlockWithTrailingLZ77Literals() throws IOException {
+ public void testRewritingOfFinalBlockWithTrailingLZ77Literals() throws IOException {
for (int i = 1; i < 5; i++) {
// LZ77Compressor will create a single byte literal
// followed by a back-reference of length 15 followed by a
@@ -250,7 +250,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void rewritingOfFourPairs() throws IOException {
+ public void testRewritingOfFourPairs() throws IOException {
// LZ77Compressor creates three times a literal block followed
// by a back-reference (once 5 bytes long and twice four bytes
// long and a final literal block of length 1
@@ -275,7 +275,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void rewritingWithFinalBackreferenceAndOffsetBiggerThan1() throws IOException {
+ public void testRewritingWithFinalBackreferenceAndOffsetBiggerThan1() throws IOException {
// this caused trouble when expandFromList() fell into the "offsetRemaining is negative" self-copy case as the
// calculation of copyOffset was wrong
final byte[] toCompress = prepareExpected(25);
@@ -298,7 +298,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCompletePair() throws IOException {
+ public void testWritesCompletePair() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
final byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
p.addLiteral(new LZ77Compressor.LiteralBlock(b, 1, 4));
@@ -311,7 +311,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCorrectSizeFor15ByteLengthLiteral() throws IOException {
+ public void testWritesCorrectSizeFor15ByteLengthLiteral() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
final byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
p.addLiteral(new LZ77Compressor.LiteralBlock(b, 0, 9));
@@ -323,7 +323,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCorrectSizeFor19ByteLengthBackReference() throws IOException {
+ public void testWritesCorrectSizeFor19ByteLengthBackReference() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 19));
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -332,7 +332,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCorrectSizeFor269ByteLengthLiteral() throws IOException {
+ public void testWritesCorrectSizeFor269ByteLengthLiteral() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
final byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
for (int i = 0; i < 26; i++) {
@@ -346,7 +346,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCorrectSizeFor270ByteLengthLiteral() throws IOException {
+ public void testWritesCorrectSizeFor270ByteLengthLiteral() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
final byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
for (int i = 0; i < 27; i++) {
@@ -359,7 +359,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCorrectSizeFor273ByteLengthBackReference() throws IOException {
+ public void testWritesCorrectSizeFor273ByteLengthBackReference() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 273));
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -368,7 +368,7 @@ public class BlockLZ4CompressorOutputStreamTest {
}
@Test
- public void writesCorrectSizeFor274ByteLengthBackReference() throws IOException {
+ public void testWritesCorrectSizeFor274ByteLengthBackReference() throws IOException {
final BlockLZ4CompressorOutputStream.Pair p = new BlockLZ4CompressorOutputStream.Pair();
p.setBackReference(new LZ77Compressor.BackReference(1, 274));
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz4/FactoryTest.java b/src/test/java/org/apache/commons/compress/compressors/lz4/FactoryTest.java
index b8f39221..3a3939e7 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz4/FactoryTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz4/FactoryTest.java
@@ -33,12 +33,12 @@ import org.junit.jupiter.api.Test;
public class FactoryTest extends AbstractTestCase {
@Test
- public void blockRoundtripViaFactory() throws Exception {
+ public void testBlockRoundtripViaFactory() throws Exception {
roundtripViaFactory(CompressorStreamFactory.getLZ4Block());
}
@Test
- public void frameRoundtripViaFactory() throws Exception {
+ public void testFrameRoundtripViaFactory() throws Exception {
roundtripViaFactory(CompressorStreamFactory.getLZ4Framed());
}
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStreamTest.java
index 3792f098..eb1356c2 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStreamTest.java
@@ -53,17 +53,17 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void backreferenceAtStartCausesIOException() {
+ public void testBackreferenceAtStartCausesIOException() {
expectIOException("COMPRESS-490/ArrayIndexOutOfBoundsException1.lz4");
}
@Test
- public void backreferenceOfSize0CausesIOException() {
+ public void testBackreferenceOfSize0CausesIOException() {
expectIOException("COMPRESS-490/ArithmeticException.lz4");
}
@Test
- public void backreferenceWithOffsetTooBigCausesIOException() {
+ public void testBackreferenceWithOffsetTooBigCausesIOException() {
expectIOException("COMPRESS-490/ArrayIndexOutOfBoundsException2.lz4");
}
@@ -77,7 +77,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.lz4");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -89,7 +89,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaDumpLz4() throws IOException {
+ public void testReadBlaDumpLz4() throws IOException {
try (InputStream a = new FramedLZ4CompressorInputStream(newInputStream("bla.dump.lz4"));
InputStream e = newInputStream("bla.dump")) {
final byte[] expected = IOUtils.toByteArray(e);
@@ -99,7 +99,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaLz4() throws IOException {
+ public void testReadBlaLz4() throws IOException {
try (InputStream a = new FramedLZ4CompressorInputStream(newInputStream("bla.tar.lz4"));
InputStream e = newInputStream("bla.tar")) {
final byte[] expected = IOUtils.toByteArray(e);
@@ -109,7 +109,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaLz4ViaFactory() throws Exception {
+ public void testReadBlaLz4ViaFactory() throws Exception {
try (InputStream a = new CompressorStreamFactory()
.createCompressorInputStream(CompressorStreamFactory.getLZ4Framed(),
newInputStream("bla.tar.lz4"));
@@ -121,7 +121,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaLz4ViaFactoryAutoDetection() throws Exception {
+ public void testReadBlaLz4ViaFactoryAutoDetection() throws Exception {
try (InputStream a = new CompressorStreamFactory()
.createCompressorInputStream(new BufferedInputStream(newInputStream("bla.tar.lz4")));
InputStream e = newInputStream("bla.tar")) {
@@ -132,7 +132,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaLz4ViaFactoryWithDecompressConcatenated() throws Exception {
+ public void testReadBlaLz4ViaFactoryWithDecompressConcatenated() throws Exception {
try (InputStream a = new CompressorStreamFactory()
.createCompressorInputStream(CompressorStreamFactory.getLZ4Framed(),
newInputStream("bla.tar.lz4"),
@@ -145,7 +145,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readBlaLz4WithDecompressConcatenated() throws IOException {
+ public void testReadBlaLz4WithDecompressConcatenated() throws IOException {
try (InputStream a = new FramedLZ4CompressorInputStream(newInputStream("bla.tar.lz4"), true);
InputStream e = newInputStream("bla.tar")) {
final byte[] expected = IOUtils.toByteArray(e);
@@ -169,40 +169,40 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readDoubledBlaLz4ViaFactoryWithDecompressConcatenatedFalse() throws Exception {
+ public void testReadDoubledBlaLz4ViaFactoryWithDecompressConcatenatedFalse() throws Exception {
readDoubledBlaLz4(in -> new CompressorStreamFactory()
.createCompressorInputStream(CompressorStreamFactory.getLZ4Framed(), in, false), false);
}
@Test
- public void readDoubledBlaLz4ViaFactoryWithDecompressConcatenatedTrue() throws Exception {
+ public void testReadDoubledBlaLz4ViaFactoryWithDecompressConcatenatedTrue() throws Exception {
readDoubledBlaLz4(in -> new CompressorStreamFactory()
.createCompressorInputStream(CompressorStreamFactory.getLZ4Framed(), in, true), true);
}
@Test
- public void readDoubledBlaLz4ViaFactoryWithoutExplicitDecompressConcatenated() throws Exception {
+ public void testReadDoubledBlaLz4ViaFactoryWithoutExplicitDecompressConcatenated() throws Exception {
readDoubledBlaLz4(in -> new CompressorStreamFactory()
.createCompressorInputStream(CompressorStreamFactory.getLZ4Framed(), in), false);
}
@Test
- public void readDoubledBlaLz4WithDecompressConcatenatedFalse() throws Exception {
+ public void testReadDoubledBlaLz4WithDecompressConcatenatedFalse() throws Exception {
readDoubledBlaLz4(in -> new FramedLZ4CompressorInputStream(in, false), false);
}
@Test
- public void readDoubledBlaLz4WithDecompressConcatenatedTrue() throws Exception {
+ public void testReadDoubledBlaLz4WithDecompressConcatenatedTrue() throws Exception {
readDoubledBlaLz4(in -> new FramedLZ4CompressorInputStream(in, true), true);
}
@Test
- public void readDoubledBlaLz4WithoutExplicitDecompressConcatenated() throws Exception {
+ public void testReadDoubledBlaLz4WithoutExplicitDecompressConcatenated() throws Exception {
readDoubledBlaLz4(FramedLZ4CompressorInputStream::new, false);
}
@Test
- public void readsUncompressedBlocks() throws IOException {
+ public void testReadsUncompressedBlocks() throws IOException {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -221,7 +221,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void readsUncompressedBlocksUsingSingleByteRead() throws IOException {
+ public void testReadsUncompressedBlocksUsingSingleByteRead() throws IOException {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -238,7 +238,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsBlocksWithoutChecksum() {
+ public void testRejectsBlocksWithoutChecksum() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x70, // flag - Version 01, block independent, with block checksum, no content size, no content checksum
@@ -256,7 +256,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsFileWithBadHeaderChecksum() {
+ public void testRejectsFileWithBadHeaderChecksum() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x64, // flag - Version 01, block independent, no block checksum, no content size, with content checksum
@@ -271,7 +271,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsFileWithInsufficientContentSize() {
+ public void testRejectsFileWithInsufficientContentSize() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x6C, // flag - Version 01, block independent, no block checksum, with content size, with content checksum
@@ -285,7 +285,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsFileWithoutBlockSizeByte() {
+ public void testRejectsFileWithoutBlockSizeByte() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x64, // flag - Version 01, block independent, no block checksum, no content size, with content checksum
@@ -298,7 +298,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsFileWithoutFrameDescriptor() {
+ public void testRejectsFileWithoutFrameDescriptor() {
final byte[] input = {
4, 0x22, 0x4d, 0x18 // signature
};
@@ -310,7 +310,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsFileWithoutHeaderChecksum() {
+ public void testRejectsFileWithoutHeaderChecksum() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x64, // flag - Version 01, block independent, no block checksum, no content size, with content checksum
@@ -324,7 +324,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsFileWithWrongVersion() {
+ public void testRejectsFileWithWrongVersion() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x24, // flag - Version 00, block independent, no block checksum, no content size, with content checksum
@@ -337,12 +337,12 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsNonLZ4Stream() {
+ public void testRejectsNonLZ4Stream() {
assertThrows(IOException.class, () -> new FramedLZ4CompressorInputStream(newInputStream("bla.tar")));
}
@Test
- public void rejectsSkippableFrameFollowedByJunk() {
+ public void testRejectsSkippableFrameFollowedByJunk() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -365,7 +365,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsSkippableFrameFollowedByTooFewBytes() {
+ public void testRejectsSkippableFrameFollowedByTooFewBytes() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -388,7 +388,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsSkippableFrameWithBadSignaturePrefix() {
+ public void testRejectsSkippableFrameWithBadSignaturePrefix() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -409,7 +409,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsSkippableFrameWithBadSignatureTrailer() {
+ public void testRejectsSkippableFrameWithBadSignatureTrailer() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -429,7 +429,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsSkippableFrameWithPrematureEnd() {
+ public void testRejectsSkippableFrameWithPrematureEnd() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -451,7 +451,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsSkippableFrameWithPrematureEndInLengthBytes() {
+ public void testRejectsSkippableFrameWithPrematureEndInLengthBytes() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -472,7 +472,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsStreamsWithBadContentChecksum() {
+ public void testRejectsStreamsWithBadContentChecksum() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x64, // flag - Version 01, block independent, no block checksum, no content size, with content checksum
@@ -492,7 +492,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsStreamsWithoutContentChecksum() {
+ public void testRejectsStreamsWithoutContentChecksum() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x64, // flag - Version 01, block independent, no block checksum, no content size, with content checksum
@@ -511,7 +511,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void rejectsTrailingBytesAfterValidFrame() {
+ public void testRejectsTrailingBytesAfterValidFrame() {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -531,7 +531,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.lz4");
try (InputStream is = Files.newInputStream(input.toPath());
FramedLZ4CompressorInputStream in = new FramedLZ4CompressorInputStream(is);) {
@@ -542,7 +542,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void skipsOverSkippableFrames() throws IOException {
+ public void testSkipsOverSkippableFrames() throws IOException {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
@@ -571,7 +571,7 @@ public final class FramedLZ4CompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void skipsOverTrailingSkippableFrames() throws IOException {
+ public void testSkipsOverTrailingSkippableFrames() throws IOException {
final byte[] input = {
4, 0x22, 0x4d, 0x18, // signature
0x60, // flag - Version 01, block independent, no block checksum, no content size, no content checksum
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStreamTest.java
index 6db6bd33..4c8e7416 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStreamTest.java
@@ -54,7 +54,7 @@ public class AbstractLZ77CompressorInputStreamTest {
}
@Test
- public void cantPrefillAfterDataHasBeenRead() throws IOException {
+ public void testCantPrefillAfterDataHasBeenRead() throws IOException {
final byte[] data = {1, 2, 3, 4};
try (TestStream s = new TestStream(new ByteArrayInputStream(data))) {
s.literal(3);
@@ -64,7 +64,7 @@ public class AbstractLZ77CompressorInputStreamTest {
}
@Test
- public void ifPrefillExceedsWindowSizeTheLastBytesAreUsed() throws IOException {
+ public void testIfPrefillExceedsWindowSizeTheLastBytesAreUsed() throws IOException {
final byte[] data = new byte[2048];
data[2046] = 3;
data[2047] = 4;
@@ -78,7 +78,7 @@ public class AbstractLZ77CompressorInputStreamTest {
}
@Test
- public void prefillCanBeUsedForBackReferences() throws IOException {
+ public void testPrefillCanBeUsedForBackReferences() throws IOException {
final byte[] data = { 1, 2, 3, 4 };
try (TestStream s = new TestStream(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY))) {
s.prefill(data);
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java b/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java
index b34f85fa..ef218343 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java
@@ -107,7 +107,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleSmallerWindowSize() throws IOException {
+ public void testBlaExampleSmallerWindowSize() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(8), BLA);
assertSize(6, blocks);
assertLiteralBlock("Blah b", blocks.get(0));
@@ -118,7 +118,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleWithFullArrayAvailableForCompression()
+ public void testBlaExampleWithFullArrayAvailableForCompression()
throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(128), BLA);
assertSize(4, blocks);
@@ -128,7 +128,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleWithPrefill() throws IOException {
+ public void testBlaExampleWithPrefill() throws IOException {
final List<LZ77Compressor.Block> blocks = new ArrayList<>();
final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> {
//System.err.println(block);
@@ -153,7 +153,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleWithPrefillBiggerThanWindowSize() throws IOException {
+ public void testBlaExampleWithPrefillBiggerThanWindowSize() throws IOException {
final List<LZ77Compressor.Block> blocks = new ArrayList<>();
final LZ77Compressor c = new LZ77Compressor(newParameters(4), block -> {
//System.err.println(block);
@@ -181,7 +181,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleWithShorterBackReferenceLength() throws IOException {
+ public void testBlaExampleWithShorterBackReferenceLength() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(128, 3, 5, 0, 0), BLA);
assertSize(7, blocks);
assertLiteralBlock("Blah b", blocks.get(0));
@@ -193,7 +193,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleWithShortPrefill() throws IOException {
+ public void testBlaExampleWithShortPrefill() throws IOException {
final List<LZ77Compressor.Block> blocks = new ArrayList<>();
final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> {
//System.err.println(block);
@@ -219,7 +219,7 @@ public class LZ77CompressorTest {
}
@Test
- public void blaExampleWithSingleByteWrites() throws IOException {
+ public void testBlaExampleWithSingleByteWrites() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(128), stagger(BLA));
assertEquals(9, blocks.size());
assertLiteralBlock("Blah b", blocks.get(0));
@@ -233,14 +233,14 @@ public class LZ77CompressorTest {
}
@Test
- public void cantPrefillAfterCompress() throws IOException {
+ public void testCantPrefillAfterCompress() throws IOException {
final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> {});
c.compress(Arrays.copyOfRange(BLA, 0, 2));
assertThrows(IllegalStateException.class, () -> c.prefill(Arrays.copyOfRange(BLA, 2, 4)));
}
@Test
- public void cantPrefillTwice() {
+ public void testCantPrefillTwice() {
final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> {});
c.prefill(Arrays.copyOfRange(BLA, 0, 2));
assertThrows(IllegalStateException.class, () -> c.prefill(Arrays.copyOfRange(BLA, 2, 4)));
@@ -270,7 +270,7 @@ public class LZ77CompressorTest {
}
@Test
- public void nonCompressableSentAsSingleBytes() throws IOException {
+ public void testNonCompressableSentAsSingleBytes() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(8), stagger(ONE_TO_TEN));
assertSize(3, blocks);
assertLiteralBlock(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }, blocks.get(0));
@@ -278,7 +278,7 @@ public class LZ77CompressorTest {
}
@Test
- public void nonCompressableWithLengthGreaterThanLiteralMaxButLessThanTwiceWindowSize() throws IOException {
+ public void testNonCompressableWithLengthGreaterThanLiteralMaxButLessThanTwiceWindowSize() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(8), ONE_TO_TEN);
assertSize(3, blocks);
assertLiteralBlock(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }, blocks.get(0));
@@ -286,14 +286,14 @@ public class LZ77CompressorTest {
}
@Test
- public void nonCompressableWithLengthSmallerThanLiteralMax() throws IOException {
+ public void testNonCompressableWithLengthSmallerThanLiteralMax() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(128), ONE_TO_TEN);
assertSize(2, blocks);
assertLiteralBlock(ONE_TO_TEN, blocks.get(0));
}
@Test
- public void nonCompressableWithLengthThatForcesWindowSlide() throws IOException {
+ public void testNonCompressableWithLengthThatForcesWindowSlide() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(4), ONE_TO_TEN);
assertSize(4, blocks);
assertLiteralBlock(new byte[] { 1, 2, 3, 4, }, blocks.get(0));
@@ -302,7 +302,7 @@ public class LZ77CompressorTest {
}
@Test
- public void samIAmExampleWithFullArrayAvailableForCompression() throws IOException {
+ public void testSamIAmExampleWithFullArrayAvailableForCompression() throws IOException {
final List<LZ77Compressor.Block> blocks = compress(newParameters(1024), SAM);
assertEquals(21, blocks.size());
assertLiteralBlock("I am Sam\n\n", blocks.get(0));
diff --git a/src/test/java/org/apache/commons/compress/compressors/lz77support/ParametersTest.java b/src/test/java/org/apache/commons/compress/compressors/lz77support/ParametersTest.java
index 817b5bee..63bb24d0 100644
--- a/src/test/java/org/apache/commons/compress/compressors/lz77support/ParametersTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/lz77support/ParametersTest.java
@@ -40,7 +40,7 @@ public class ParametersTest {
}
@Test
- public void allParametersUsuallyTakeTheirSpecifiedValues() {
+ public void testAllParametersUsuallyTakeTheirSpecifiedValues() {
final Parameters p = newParameters(256, 4, 5, 6, 7);
assertEquals(256, p.getWindowSize());
assertEquals(4, p.getMinBackReferenceLength());
@@ -50,7 +50,7 @@ public class ParametersTest {
}
@Test
- public void defaultConstructor() {
+ public void testDefaultConstructor() {
final Parameters p = newParameters(128);
assertEquals(128, p.getWindowSize());
assertEquals(3, p.getMinBackReferenceLength());
@@ -60,19 +60,19 @@ public class ParametersTest {
}
@Test
- public void maxBackReferenceLengthIsMinBackReferenceLengthIfBothAreEqual() {
+ public void testMaxBackReferenceLengthIsMinBackReferenceLengthIfBothAreEqual() {
final Parameters p = newParameters(128, 2, 3, 4, 5);
assertEquals(3, p.getMaxBackReferenceLength());
}
@Test
- public void maxBackReferenceLengthIsMinBackReferenceLengthWhenSmallerThanMinBackReferenceLength() {
+ public void testMaxBackReferenceLengthIsMinBackReferenceLengthWhenSmallerThanMinBackReferenceLength() {
final Parameters p = newParameters(128, 2, 2, 4, 5);
assertEquals(3, p.getMaxBackReferenceLength());
}
@Test
- public void maxBackReferenceLengthIsMinBackReferenceLengthWhenSmallerThanMinBackReferenceLengthReversedInvocationOrder() {
+ public void testMaxBackReferenceLengthIsMinBackReferenceLengthWhenSmallerThanMinBackReferenceLengthReversedInvocationOrder() {
final Parameters p = Parameters.builder(128)
.withMaxBackReferenceLength(2)
.withMinBackReferenceLength(2)
@@ -83,54 +83,54 @@ public class ParametersTest {
}
@Test
- public void maxLiteralLengthIsWindowSizeIfSetTo0() {
+ public void testMaxLiteralLengthIsWindowSizeIfSetTo0() {
final Parameters p = newParameters(128, 2, 3, 4, 0);
assertEquals(128, p.getMaxLiteralLength());
}
@Test
- public void maxLiteralLengthIsWindowSizeIfSetToANegativeValue() {
+ public void testMaxLiteralLengthIsWindowSizeIfSetToANegativeValue() {
final Parameters p = newParameters(128, 2, 3, 0, -1);
assertEquals(128, p.getMaxLiteralLength());
}
@Test
- public void maxLiteralLengthIsWindowSizeIfSetToAValueTooBigToHoldInSlidingWindow() {
+ public void testMaxLiteralLengthIsWindowSizeIfSetToAValueTooBigToHoldInSlidingWindow() {
final Parameters p = newParameters(128, 2, 3, 0, 259);
assertEquals(128, p.getMaxLiteralLength());
}
@Test
- public void maxOffsetIsWindowSizeMinus1IfBiggerThanWindowSize() {
+ public void testMaxOffsetIsWindowSizeMinus1IfBiggerThanWindowSize() {
final Parameters p = newParameters(128, 2, 3, 129, 5);
assertEquals(127, p.getMaxOffset());
}
@Test
- public void maxOffsetIsWindowSizeMinus1IfSetTo0() {
+ public void testMaxOffsetIsWindowSizeMinus1IfSetTo0() {
final Parameters p = newParameters(128, 2, 3, 0, 5);
assertEquals(127, p.getMaxOffset());
}
@Test
- public void maxOffsetIsWindowSizeMinus1IfSetToANegativeValue() {
+ public void testMaxOffsetIsWindowSizeMinus1IfSetToANegativeValue() {
final Parameters p = newParameters(128, 2, 3, -1, 5);
assertEquals(127, p.getMaxOffset());
}
@Test
- public void minBackReferenceLengthIsAtLeastThree() {
+ public void testMinBackReferenceLengthIsAtLeastThree() {
final Parameters p = newParameters(128, 2, 3, 4, 5);
assertEquals(3, p.getMinBackReferenceLength());
}
@Test
- public void windowSizeMustBeAPowerOfTwo() {
+ public void testWindowSizeMustBeAPowerOfTwo() {
assertThrows(IllegalArgumentException.class, () -> newParameters(100, 200, 300, 400, 500));
}
@Test
- public void windowSizeMustNotBeSmallerThanMinBackReferenceLength() {
+ public void testWindowSizeMustNotBeSmallerThanMinBackReferenceLength() {
assertThrows(IllegalArgumentException.class, () -> newParameters(128, 200, 300, 400, 500));
}
}
diff --git a/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
index 53c98f8c..6c52322d 100644
--- a/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStreamTest.java
@@ -44,7 +44,7 @@ public final class FramedSnappyCompressorInputStreamTest extends AbstractTestCas
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.sz");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -56,7 +56,7 @@ public final class FramedSnappyCompressorInputStreamTest extends AbstractTestCas
}
@Test
- public void readIWAFile() throws Exception {
+ public void testReadIWAFile() throws Exception {
try (ZipFile zip = new ZipFile(getFile("testNumbersNew.numbers"))) {
try (InputStream is = zip.getInputStream(zip.getEntry("Index/Document.iwa"))) {
try (FramedSnappyCompressorInputStream in = new FramedSnappyCompressorInputStream(is, FramedSnappyDialect.IWORK_ARCHIVE)) {
@@ -70,7 +70,7 @@ public final class FramedSnappyCompressorInputStreamTest extends AbstractTestCas
* @see "https://issues.apache.org/jira/browse/COMPRESS-358"
*/
@Test
- public void readIWAFileWithBiggerOffset() throws Exception {
+ public void testReadIWAFileWithBiggerOffset() throws Exception {
final File o = new File(dir, "COMPRESS-358.raw");
try (InputStream is = newInputStream("COMPRESS-358.iwa");
FramedSnappyCompressorInputStream in = new FramedSnappyCompressorInputStream(is, 1 << 16, FramedSnappyDialect.IWORK_ARCHIVE);) {
@@ -85,7 +85,7 @@ public final class FramedSnappyCompressorInputStreamTest extends AbstractTestCas
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.sz");
try (InputStream is = Files.newInputStream(input.toPath());
FramedSnappyCompressorInputStream in = new FramedSnappyCompressorInputStream(is);) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/snappy/SnappyRoundtripTest.java b/src/test/java/org/apache/commons/compress/compressors/snappy/SnappyRoundtripTest.java
index fef98b80..4d29f449 100644
--- a/src/test/java/org/apache/commons/compress/compressors/snappy/SnappyRoundtripTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/snappy/SnappyRoundtripTest.java
@@ -48,19 +48,19 @@ public final class SnappyRoundtripTest extends AbstractTestCase {
// yields no compression at all
@Test
- public void biggerFileRoundtrip() throws IOException {
+ public void testBiggerFileRoundtrip() throws IOException {
roundTripTest("COMPRESS-256.7z");
}
// should yield decent compression
@Test
- public void blaTarRoundtrip() throws IOException {
+ public void testBlaTarRoundtrip() throws IOException {
// System.err.println("Configuration: default");
roundTripTest("bla.tar");
}
@Test
- public void blaTarRoundtripTunedForCompressionRatio() throws IOException {
+ public void testBlaTarRoundtripTunedForCompressionRatio() throws IOException {
// System.err.println("Configuration: tuned for compression ratio");
roundTripTest(getFile("bla.tar"),
SnappyCompressorOutputStream.createParameterBuilder(SnappyCompressorInputStream.DEFAULT_BLOCK_SIZE)
@@ -69,7 +69,7 @@ public final class SnappyRoundtripTest extends AbstractTestCase {
}
@Test
- public void blaTarRoundtripTunedForSpeed() throws IOException {
+ public void testBlaTarRoundtripTunedForSpeed() throws IOException {
// System.err.println("Configuration: tuned for speed");
roundTripTest(getFile("bla.tar"),
SnappyCompressorOutputStream.createParameterBuilder(SnappyCompressorInputStream.DEFAULT_BLOCK_SIZE)
@@ -79,7 +79,7 @@ public final class SnappyRoundtripTest extends AbstractTestCase {
// yields no compression at all
@Test
- public void gzippedLoremIpsumRoundtrip() throws IOException {
+ public void testGzippedLoremIpsumRoundtrip() throws IOException {
roundTripTest("lorem-ipsum.txt.gz");
}
diff --git a/src/test/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStreamTest.java
index 2e6803b2..b9e7431b 100644
--- a/src/test/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/xz/XZCompressorInputStreamTest.java
@@ -44,17 +44,17 @@ public class XZCompressorInputStreamTest {
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofDecompressConcatenated() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofDecompressConcatenated() throws IOException {
multiByteReadConsistentlyReturnsMinusOneAtEof(true);
}
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEofNoDecompressConcatenated() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEofNoDecompressConcatenated() throws IOException {
multiByteReadConsistentlyReturnsMinusOneAtEof(false);
}
@Test
- public void redundantTestOfAlmostDeprecatedMatchesMethod() {
+ public void testRedundantTestOfAlmostDeprecatedMatchesMethod() {
final byte[] data = { (byte) 0xFD, '7', 'z', 'X', 'Z', '\0' };
assertFalse(XZCompressorInputStream.matches(data, 5));
assertTrue(XZCompressorInputStream.matches(data, 6));
@@ -74,12 +74,12 @@ public class XZCompressorInputStreamTest {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofDecompressConcatenated() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofDecompressConcatenated() throws IOException {
singleByteReadConsistentlyReturnsMinusOneAtEof(true);
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEofNoDecompressConcatenated() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEofNoDecompressConcatenated() throws IOException {
singleByteReadConsistentlyReturnsMinusOneAtEof(false);
}
diff --git a/src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java
index 00542ef6..0889d1b3 100644
--- a/src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java
@@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test;
public class ZCompressorInputStreamTest {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.Z");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -52,7 +52,7 @@ public class ZCompressorInputStreamTest {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("bla.tar.Z");
try (InputStream is = Files.newInputStream(input.toPath());
ZCompressorInputStream in = new ZCompressorInputStream(is)) {
diff --git a/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStreamTest.java
index 232ae348..f9dae59f 100644
--- a/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdCompressorInputStreamTest.java
@@ -39,7 +39,7 @@ import com.github.luben.zstd.RecyclingBufferPool;
public class ZstdCompressorInputStreamTest extends AbstractTestCase {
@Test
- public void multiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("zstandard.testdata.zst");
final byte[] buf = new byte[2];
try (InputStream is = Files.newInputStream(input.toPath());
@@ -51,7 +51,7 @@ public class ZstdCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void shouldBeAbleToSkipAByte() throws IOException {
+ public void testShouldBeAbleToSkipAByte() throws IOException {
final File input = getFile("zstandard.testdata.zst");
try (InputStream is = Files.newInputStream(input.toPath());
ZstdCompressorInputStream in = new ZstdCompressorInputStream(is)) {
@@ -60,7 +60,7 @@ public class ZstdCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
+ public void testSingleByteReadConsistentlyReturnsMinusOneAtEof() throws IOException {
final File input = getFile("zstandard.testdata.zst");
try (InputStream is = Files.newInputStream(input.toPath());
ZstdCompressorInputStream in = new ZstdCompressorInputStream(is)) {
@@ -71,7 +71,7 @@ public class ZstdCompressorInputStreamTest extends AbstractTestCase {
}
@Test
- public void singleByteReadWorksAsExpected() throws IOException {
+ public void testSingleByteReadWorksAsExpected() throws IOException {
final File input = getFile("zstandard.testdata.zst");
diff --git a/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdRoundtripTest.java b/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdRoundtripTest.java
index 8aab4c4f..ca5b4edf 100644
--- a/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdRoundtripTest.java
+++ b/src/test/java/org/apache/commons/compress/compressors/zstandard/ZstdRoundtripTest.java
@@ -40,12 +40,12 @@ public class ZstdRoundtripTest extends AbstractTestCase {
}
@Test
- public void directRoundtrip() throws Exception {
+ public void testDirectRoundtrip() throws Exception {
roundtrip(ZstdCompressorOutputStream::new);
}
@Test
- public void factoryRoundtrip() throws Exception {
+ public void testFactoryRoundtrip() throws Exception {
final File input = getFile("bla.tar");
long start = System.currentTimeMillis();
final File output = new File(dir, input.getName() + ".zstd");
@@ -83,17 +83,17 @@ public class ZstdRoundtripTest extends AbstractTestCase {
}
@Test
- public void roundtripWithChecksum() throws Exception {
+ public void testRoundtripWithChecksum() throws Exception {
roundtrip(os -> new ZstdCompressorOutputStream(os, 3, false, true));
}
@Test
- public void roundtripWithCloseFrameOnFlush() throws Exception {
+ public void testRoundtripWithCloseFrameOnFlush() throws Exception {
roundtrip(os -> new ZstdCompressorOutputStream(os, 3, true));
}
@Test
- public void roundtripWithCustomLevel() throws Exception {
+ public void testRoundtripWithCustomLevel() throws Exception {
roundtrip(os -> new ZstdCompressorOutputStream(os, 1));
}
diff --git a/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java
index c0b42351..e573c25c 100644
--- a/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/BitInputStreamTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
public class BitInputStreamTest {
@Test
- public void alignWithByteBoundaryWhenAtBoundary() throws Exception {
+ public void testAlignWithByteBoundaryWhenAtBoundary() throws Exception {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
assertEquals(0xF8, bis.readBits(8));
bis.alignWithByteBoundary();
@@ -39,7 +39,7 @@ public class BitInputStreamTest {
}
@Test
- public void alignWithByteBoundaryWhenNotAtBoundary() throws Exception {
+ public void testAlignWithByteBoundaryWhenNotAtBoundary() throws Exception {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
assertEquals(0x08, bis.readBits(4));
assertEquals(4, bis.bitsCached());
@@ -50,7 +50,7 @@ public class BitInputStreamTest {
}
@Test
- public void availableWithCache() throws Exception {
+ public void testAvailableWithCache() throws Exception {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
assertEquals(0x08, bis.readBits(4));
assertEquals(28, bis.bitsAvailable());
@@ -58,14 +58,14 @@ public class BitInputStreamTest {
}
@Test
- public void availableWithoutCache() throws Exception {
+ public void testAvailableWithoutCache() throws Exception {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
assertEquals(32, bis.bitsAvailable());
}
}
@Test
- public void bigEndianWithOverflow() throws Exception {
+ public void testBigEndianWithOverflow() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(new byte[] {
87, // 01010111
45, // 00101101
@@ -101,7 +101,7 @@ public class BitInputStreamTest {
* @see "https://issues.apache.org/jira/browse/COMPRESS-363"
*/
@Test
- public void littleEndianWithOverflow() throws Exception {
+ public void testLittleEndianWithOverflow() throws Exception {
final ByteArrayInputStream in = new ByteArrayInputStream(new byte[] {
87, // 01010111
45, // 00101101
@@ -126,14 +126,14 @@ public class BitInputStreamTest {
}
@Test
- public void shouldNotAllowReadingOfANegativeAmountOfBits() throws IOException {
+ public void testShouldNotAllowReadingOfANegativeAmountOfBits() throws IOException {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
assertThrows(IOException.class, () -> bis.readBits(-1));
}
}
@Test
- public void shouldNotAllowReadingOfMoreThan63BitsAtATime() throws IOException {
+ public void testShouldNotAllowReadingOfMoreThan63BitsAtATime() throws IOException {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
assertThrows(IOException.class, () -> bis.readBits(64));
}
diff --git a/src/test/java/org/apache/commons/compress/utils/BoundedSeekableByteChannelInputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/BoundedSeekableByteChannelInputStreamTest.java
index 229eed53..666130d2 100644
--- a/src/test/java/org/apache/commons/compress/utils/BoundedSeekableByteChannelInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/BoundedSeekableByteChannelInputStreamTest.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
public class BoundedSeekableByteChannelInputStreamTest {
@Test
- public void checkRestrictedRead() throws IOException {
+ public void testCheckRestrictedRead() throws IOException {
byte[] readContent;
try (SeekableInMemoryByteChannel channel = new SeekableInMemoryByteChannel("Hello World!".getBytes(UTF_8));
BoundedSeekableByteChannelInputStream input = new BoundedSeekableByteChannelInputStream(0, 5, channel)) {
diff --git a/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java
index ba5cc1c4..d652eabf 100644
--- a/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/ByteUtilsTest.java
@@ -40,105 +40,105 @@ import org.junit.jupiter.api.Test;
public class ByteUtilsTest {
@Test
- public void fromLittleEndianFromArray() {
+ public void testFromLittleEndianFromArray() {
final byte[] b = { 1, 2, 3, 4, 5 };
assertEquals(2 + 3 * 256 + 4 * 256 * 256, fromLittleEndian(b, 1, 3));
}
@Test
- public void fromLittleEndianFromArrayOneArg() {
+ public void testFromLittleEndianFromArrayOneArg() {
final byte[] b = { 2, 3, 4 };
assertEquals(2 + 3 * 256 + 4 * 256 * 256, fromLittleEndian(b));
}
@Test
- public void fromLittleEndianFromArrayOneArgThrowsForLengthTooBig() {
+ public void testFromLittleEndianFromArrayOneArgThrowsForLengthTooBig() {
assertThrows(IllegalArgumentException.class, () -> fromLittleEndian(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }));
}
@Test
- public void fromLittleEndianFromArrayOneArgUnsignedInt32() {
+ public void testFromLittleEndianFromArrayOneArgUnsignedInt32() {
final byte[] b = { 2, 3, 4, (byte) 128 };
assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(b));
}
@Test
- public void fromLittleEndianFromArrayThrowsForLengthTooBig() {
+ public void testFromLittleEndianFromArrayThrowsForLengthTooBig() {
assertThrows(IllegalArgumentException.class, () -> fromLittleEndian(ByteUtils.EMPTY_BYTE_ARRAY, 0, 9));
}
@Test
- public void fromLittleEndianFromArrayUnsignedInt32() {
+ public void testFromLittleEndianFromArrayUnsignedInt32() {
final byte[] b = { 1, 2, 3, 4, (byte) 128 };
assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(b, 1, 4));
}
@Test
- public void fromLittleEndianFromDataInput() throws IOException {
+ public void testFromLittleEndianFromDataInput() throws IOException {
final DataInput din = new DataInputStream(new ByteArrayInputStream(new byte[] { 2, 3, 4, 5 }));
assertEquals(2 + 3 * 256 + 4 * 256 * 256, fromLittleEndian(din, 3));
}
@Test
- public void fromLittleEndianFromDataInputThrowsForLengthTooBig() {
+ public void testFromLittleEndianFromDataInputThrowsForLengthTooBig() {
final DataInput din = new DataInputStream(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY));
assertThrows(IllegalArgumentException.class, () -> fromLittleEndian(din, 9));
}
@Test
- public void fromLittleEndianFromDataInputThrowsForPrematureEnd() {
+ public void testFromLittleEndianFromDataInputThrowsForPrematureEnd() {
final DataInput din = new DataInputStream(new ByteArrayInputStream(new byte[] { 2, 3 }));
assertThrows(EOFException.class, () -> fromLittleEndian(din, 3));
}
@Test
- public void fromLittleEndianFromDataInputUnsignedInt32() throws IOException {
+ public void testFromLittleEndianFromDataInputUnsignedInt32() throws IOException {
final DataInput din = new DataInputStream(new ByteArrayInputStream(new byte[] { 2, 3, 4, (byte) 128 }));
assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(din, 4));
}
@Test
- public void fromLittleEndianFromStream() throws IOException {
+ public void testFromLittleEndianFromStream() throws IOException {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3, 4, 5 });
assertEquals(2 + 3 * 256 + 4 * 256 * 256, fromLittleEndian(bin, 3));
}
@Test
- public void fromLittleEndianFromStreamThrowsForLengthTooBig() {
+ public void testFromLittleEndianFromStreamThrowsForLengthTooBig() {
assertThrows(IllegalArgumentException.class, () -> fromLittleEndian(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), 9));
}
@Test
- public void fromLittleEndianFromStreamThrowsForPrematureEnd() {
+ public void testFromLittleEndianFromStreamThrowsForPrematureEnd() {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3 });
assertThrows(IOException.class, () -> fromLittleEndian(bin, 3));
}
@Test
- public void fromLittleEndianFromStreamUnsignedInt32() throws IOException {
+ public void testFromLittleEndianFromStreamUnsignedInt32() throws IOException {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3, 4, (byte) 128 });
assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256, fromLittleEndian(bin, 4));
}
@Test
- public void fromLittleEndianFromSupplier() throws IOException {
+ public void testFromLittleEndianFromSupplier() throws IOException {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3, 4, 5 });
assertEquals(2 + 3 * 256 + 4 * 256 * 256, fromLittleEndian(new InputStreamByteSupplier(bin), 3));
}
@Test
- public void fromLittleEndianFromSupplierThrowsForLengthTooBig() {
+ public void testFromLittleEndianFromSupplierThrowsForLengthTooBig() {
assertThrows(IllegalArgumentException.class, () -> fromLittleEndian(new InputStreamByteSupplier(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY)), 9));
}
@Test
- public void fromLittleEndianFromSupplierThrowsForPrematureEnd() {
+ public void testFromLittleEndianFromSupplierThrowsForPrematureEnd() {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3 });
assertThrows(IOException.class, () -> fromLittleEndian(new InputStreamByteSupplier(bin), 3));
}
@Test
- public void fromLittleEndianFromSupplierUnsignedInt32() throws IOException {
+ public void testFromLittleEndianFromSupplierUnsignedInt32() throws IOException {
final ByteArrayInputStream bin = new ByteArrayInputStream(new byte[] { 2, 3, 4, (byte) 128 });
assertEquals(2 + 3 * 256 + 4 * 256 * 256 + 128L * 256 * 256 * 256,
fromLittleEndian(new InputStreamByteSupplier(bin), 4));
diff --git a/src/test/java/org/apache/commons/compress/utils/CountingStreamTest.java b/src/test/java/org/apache/commons/compress/utils/CountingStreamTest.java
index 295a8775..bfb89a59 100644
--- a/src/test/java/org/apache/commons/compress/utils/CountingStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/CountingStreamTest.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
public class CountingStreamTest {
@Test
- public void input() throws Exception {
+ public void testInput() throws Exception {
// I don't like "test all at once" tests either, but the class
// is so trivial
final ByteArrayInputStream bis =
@@ -53,7 +53,7 @@ public class CountingStreamTest {
}
@Test
- public void output() throws Exception {
+ public void testOutput() throws Exception {
// I don't like "test all at once" tests either, but the class
// is so trivial
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
diff --git a/src/test/java/org/apache/commons/compress/utils/FileNameUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/FileNameUtilsTest.java
index b0f18176..86acf71c 100644
--- a/src/test/java/org/apache/commons/compress/utils/FileNameUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/FileNameUtilsTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
public class FileNameUtilsTest {
@Test
- public void getBaseNamePathBaseCases() {
+ public void testGetBaseNamePathBaseCases() {
assertEquals("bar", FileNameUtils.getBaseName(Paths.get("a/b/c/bar.foo")));
assertEquals("foo", FileNameUtils.getBaseName(Paths.get("foo")));
assertEquals("", FileNameUtils.getBaseName(Paths.get("")));
@@ -44,27 +44,27 @@ public class FileNameUtilsTest {
}
@Test
- public void getBaseNamePathCornerCases() {
+ public void testGetBaseNamePathCornerCases() {
assertNull(FileNameUtils.getBaseName((Path) null));
assertEquals("foo", FileNameUtils.getBaseName(Paths.get("foo.")));
assertEquals("", FileNameUtils.getBaseName(Paths.get("bar/.foo")));
}
@Test
- public void getBaseNameStringBaseCases() {
+ public void testGetBaseNameStringBaseCases() {
assertEquals("bar", FileNameUtils.getBaseName("a/b/c/bar.foo"));
assertEquals("foo", FileNameUtils.getBaseName("foo"));
}
@Test
- public void getBaseNameStringCornerCases() {
+ public void testGetBaseNameStringCornerCases() {
assertNull(FileNameUtils.getBaseName((String) null));
assertEquals("foo", FileNameUtils.getBaseName("foo."));
assertEquals("", FileNameUtils.getBaseName("bar/.foo"));
}
@Test
- public void getExtensionPathBaseCases() {
+ public void testGetExtensionPathBaseCases() {
assertEquals("foo", FileNameUtils.getExtension(Paths.get("a/b/c/bar.foo")));
assertEquals("", FileNameUtils.getExtension(Paths.get("foo")));
assertEquals("", FileNameUtils.getExtension(Paths.get("")));
@@ -78,20 +78,20 @@ public class FileNameUtilsTest {
}
@Test
- public void getExtensionPathCornerCases() {
+ public void testGetExtensionPathCornerCases() {
assertNull(FileNameUtils.getExtension((String) null));
assertEquals("", FileNameUtils.getExtension(Paths.get("foo.")));
assertEquals("foo", FileNameUtils.getExtension(Paths.get("bar/.foo")));
}
@Test
- public void getExtensionStringBaseCases() {
+ public void testGetExtensionStringBaseCases() {
assertEquals("foo", FileNameUtils.getExtension("a/b/c/bar.foo"));
assertEquals("", FileNameUtils.getExtension("foo"));
}
@Test
- public void getExtensionStringCornerCases() {
+ public void testGetExtensionStringCornerCases() {
assertNull(FileNameUtils.getExtension((String) null));
assertEquals("", FileNameUtils.getExtension("foo."));
assertEquals("foo", FileNameUtils.getExtension("bar/.foo"));
diff --git a/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
index 27cbfbf6..1bb988c8 100644
--- a/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/IOUtilsTest.java
@@ -44,7 +44,7 @@ public class IOUtilsTest {
}
@Test
- public void copyRangeDoesntCopyMoreThanAskedFor() throws IOException {
+ public void testCopyRangeDoesntCopyMoreThanAskedFor() throws IOException {
try (ByteArrayInputStream in = new ByteArrayInputStream(new byte[] { 1, 2, 3, 4, 5 });
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
assertEquals(3, IOUtils.copyRange(in, 3, out));
@@ -54,7 +54,7 @@ public class IOUtilsTest {
}
@Test
- public void copyRangeStopsIfThereIsNothingToCopyAnymore() throws IOException {
+ public void testCopyRangeStopsIfThereIsNothingToCopyAnymore() throws IOException {
try (ByteArrayInputStream in = new ByteArrayInputStream(new byte[] { 1, 2, 3, 4, 5 });
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
assertEquals(5, IOUtils.copyRange(in, 10, out));
@@ -64,18 +64,18 @@ public class IOUtilsTest {
}
@Test
- public void copyRangeThrowsOnZeroBufferSize() {
+ public void testCopyRangeThrowsOnZeroBufferSize() {
assertThrows(IllegalArgumentException.class,
() -> IOUtils.copyRange(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), 5, new ByteArrayOutputStream(), 0));
}
@Test
- public void copyThrowsOnZeroBufferSize() {
+ public void testCopyThrowsOnZeroBufferSize() {
assertThrows(IllegalArgumentException.class, () -> IOUtils.copy(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), new ByteArrayOutputStream(), 0));
}
@Test
- public void readFullyOnChannelReadsFully() throws IOException {
+ public void testReadFullyOnChannelReadsFully() throws IOException {
final ByteBuffer b = ByteBuffer.allocate(20);
final byte[] source = new byte[20];
for (byte i = 0; i < 20; i++) {
@@ -86,7 +86,7 @@ public class IOUtilsTest {
}
@Test
- public void readFullyOnChannelThrowsEof() {
+ public void testReadFullyOnChannelThrowsEof() {
final ByteBuffer b = ByteBuffer.allocate(21);
final byte[] source = new byte[20];
for (byte i = 0; i < 20; i++) {
@@ -96,7 +96,7 @@ public class IOUtilsTest {
}
@Test
- public void readRangeFromChannelDoesntReadMoreThanAskedFor() throws IOException {
+ public void testReadRangeFromChannelDoesntReadMoreThanAskedFor() throws IOException {
try (ReadableByteChannel in = new SeekableInMemoryByteChannel(new byte[] { 1, 2, 3, 4, 5 })) {
final byte[] read = IOUtils.readRange(in, 3);
assertArrayEquals(new byte[] { 1, 2, 3 }, read);
@@ -107,7 +107,7 @@ public class IOUtilsTest {
}
@Test
- public void readRangeFromChannelDoesntReadMoreThanAskedForWhenItGotLessInFirstReadCall() throws IOException {
+ public void testReadRangeFromChannelDoesntReadMoreThanAskedForWhenItGotLessInFirstReadCall() throws IOException {
try (ReadableByteChannel in = new SeekableInMemoryByteChannel(new byte[] { 1, 2, 3, 4, 5, 6, 7 }) {
@Override
public int read(ByteBuffer buf) throws IOException {
@@ -126,7 +126,7 @@ public class IOUtilsTest {
}
@Test
- public void readRangeFromChannelStopsIfThereIsNothingToReadAnymore() throws IOException {
+ public void testReadRangeFromChannelStopsIfThereIsNothingToReadAnymore() throws IOException {
try (ReadableByteChannel in = new SeekableInMemoryByteChannel(new byte[] { 1, 2, 3, 4, 5 })) {
final byte[] read = IOUtils.readRange(in, 10);
assertArrayEquals(new byte[] { 1, 2, 3, 4, 5 }, read);
@@ -136,7 +136,7 @@ public class IOUtilsTest {
}
@Test
- public void readRangeFromStreamDoesntReadMoreThanAskedFor() throws IOException {
+ public void testReadRangeFromStreamDoesntReadMoreThanAskedFor() throws IOException {
try (ByteArrayInputStream in = new ByteArrayInputStream(new byte[] { 1, 2, 3, 4, 5 })) {
final byte[] read = IOUtils.readRange(in, 3);
assertArrayEquals(new byte[] { 1, 2, 3 }, read);
@@ -145,7 +145,7 @@ public class IOUtilsTest {
}
@Test
- public void readRangeFromStreamStopsIfThereIsNothingToReadAnymore() throws IOException {
+ public void testReadRangeFromStreamStopsIfThereIsNothingToReadAnymore() throws IOException {
try (ByteArrayInputStream in = new ByteArrayInputStream(new byte[] { 1, 2, 3, 4, 5 })) {
final byte[] read = IOUtils.readRange(in, 10);
assertArrayEquals(new byte[] { 1, 2, 3, 4, 5 }, read);
@@ -154,7 +154,7 @@ public class IOUtilsTest {
}
@Test
- public void readRangeMoreThanCopyBufferSize() throws Exception {
+ public void testReadRangeMoreThanCopyBufferSize() throws Exception {
final Field COPY_BUF_SIZE = IOUtils.class.getDeclaredField("COPY_BUF_SIZE");
COPY_BUF_SIZE.setAccessible(true);
final int copyBufSize = (int) COPY_BUF_SIZE.get(null);
@@ -181,7 +181,7 @@ public class IOUtilsTest {
}
@Test
- public void skipUsingRead() throws Exception {
+ public void testSkipUsingRead() throws Exception {
skip(toWrap -> new FilterInputStream(toWrap) {
@Override
public long skip(final long s) {
@@ -191,12 +191,12 @@ public class IOUtilsTest {
}
@Test
- public void skipUsingSkip() throws Exception {
+ public void testSkipUsingSkip() throws Exception {
skip(toWrap -> toWrap);
}
@Test
- public void skipUsingSkipAndRead() throws Exception {
+ public void testSkipUsingSkipAndRead() throws Exception {
skip(toWrap -> new FilterInputStream(toWrap) {
boolean skipped;
@Override
diff --git a/src/test/java/org/apache/commons/compress/utils/MultiReadOnlySeekableByteChannelTest.java b/src/test/java/org/apache/commons/compress/utils/MultiReadOnlySeekableByteChannelTest.java
index 91b9092d..d42f4625 100644
--- a/src/test/java/org/apache/commons/compress/utils/MultiReadOnlySeekableByteChannelTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/MultiReadOnlySeekableByteChannelTest.java
@@ -82,21 +82,21 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void cantPositionToANegativePosition() throws IOException {
+ public void testCantPositionToANegativePosition() throws IOException {
try (SeekableByteChannel s = MultiReadOnlySeekableByteChannel.forSeekableByteChannels(makeEmpty(), makeEmpty())) {
assertThrows(IllegalArgumentException.class, () -> s.position(-1));
}
}
@Test
- public void cantTruncate() throws IOException {
+ public void testCantTruncate() throws IOException {
try (SeekableByteChannel s = MultiReadOnlySeekableByteChannel.forSeekableByteChannels(makeEmpty(), makeEmpty())) {
assertThrows(NonWritableChannelException.class, () -> s.truncate(1));
}
}
@Test
- public void cantWrite() {
+ public void testCantWrite() {
final SeekableByteChannel s = MultiReadOnlySeekableByteChannel.forSeekableByteChannels(makeEmpty(), makeEmpty());
assertThrows(NonWritableChannelException.class, () -> s.write(ByteBuffer.allocate(10)));
}
@@ -184,12 +184,12 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void checkForSingleByte() throws IOException {
+ public void testCheckForSingleByte() throws IOException {
check(new byte[] { 0 });
}
@Test
- public void checkForString() throws IOException {
+ public void testCheckForString() throws IOException {
check("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
.getBytes(UTF_8));
}
@@ -198,7 +198,7 @@ public class MultiReadOnlySeekableByteChannelTest {
* <q>If the stream is already closed then invoking this method has no effect.</q>
*/
@Test
- public void closeIsIdempotent() throws Exception {
+ public void testCloseIsIdempotent() throws Exception {
try (SeekableByteChannel c = testChannel()) {
c.close();
assertFalse(c.isOpen());
@@ -208,7 +208,7 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void closesAllAndThrowsExceptionIfCloseThrows() {
+ public void testClosesAllAndThrowsExceptionIfCloseThrows() {
final SeekableByteChannel[] ts = new ThrowingSeekableByteChannel[] {
new ThrowingSeekableByteChannel(),
new ThrowingSeekableByteChannel()
@@ -220,17 +220,17 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void constructorThrowsOnNullArg() {
+ public void testConstructorThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> new MultiReadOnlySeekableByteChannel(null));
}
@Test
- public void forFilesThrowsOnNullArg() {
+ public void testForFilesThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> MultiReadOnlySeekableByteChannel.forFiles(null));
}
@Test
- public void forSeekableByteChannelsReturnsIdentityForSingleElement() throws IOException {
+ public void testForSeekableByteChannelsReturnsIdentityForSingleElement() throws IOException {
try (SeekableByteChannel e = makeEmpty();
SeekableByteChannel m = MultiReadOnlySeekableByteChannel.forSeekableByteChannels(e)) {
assertSame(e, m);
@@ -238,7 +238,7 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void forSeekableByteChannelsThrowsOnNullArg() {
+ public void testForSeekableByteChannelsThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> MultiReadOnlySeekableByteChannel.forSeekableByteChannels(null));
}
@@ -276,7 +276,7 @@ public class MultiReadOnlySeekableByteChannelTest {
* indication</q>
*/
@Test
- public void readingFromAPositionAfterEndReturnsEOF() throws Exception {
+ public void testReadingFromAPositionAfterEndReturnsEOF() throws Exception {
try (SeekableByteChannel c = testChannel()) {
c.position(2);
assertEquals(2, c.position());
@@ -286,7 +286,7 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void referenceBehaviorForEmptyChannel() throws IOException {
+ public void testReferenceBehaviorForEmptyChannel() throws IOException {
checkEmpty(makeEmpty());
}
@@ -357,7 +357,7 @@ public class MultiReadOnlySeekableByteChannelTest {
}
@Test
- public void verifyGrouped() {
+ public void testVerifyGrouped() {
assertArrayEquals(new byte[][] {
new byte[] { 1, 2, 3, },
new byte[] { 4, 5, 6, },
diff --git a/src/test/java/org/apache/commons/compress/utils/OsgiUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/OsgiUtilsTest.java
index 53d36069..f2fe4b78 100644
--- a/src/test/java/org/apache/commons/compress/utils/OsgiUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/OsgiUtilsTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
public class OsgiUtilsTest {
@Test
- public void detectsItIsNotRunningInsideOsgiEnv() {
+ public void testDetectsItIsNotRunningInsideOsgiEnv() {
assertFalse(OsgiUtils.isRunningInOsgiEnvironment());
}
diff --git a/src/test/java/org/apache/commons/compress/utils/SeekableInMemoryByteChannelTest.java b/src/test/java/org/apache/commons/compress/utils/SeekableInMemoryByteChannelTest.java
index cbbbe448..60eefe16 100644
--- a/src/test/java/org/apache/commons/compress/utils/SeekableInMemoryByteChannelTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/SeekableInMemoryByteChannelTest.java
@@ -41,7 +41,7 @@ public class SeekableInMemoryByteChannelTest {
* <q>If the stream is already closed then invoking this method has no effect.</q>
*/
@Test
- public void closeIsIdempotent() throws Exception {
+ public void testCloseIsIdempotent() throws Exception {
try (SeekableByteChannel c = new SeekableInMemoryByteChannel()) {
c.close();
assertFalse(c.isOpen());
@@ -55,7 +55,7 @@ public class SeekableInMemoryByteChannelTest {
* bytes at such a position will immediately return an end-of-file indication</q>
*/
@Test
- public void readingFromAPositionAfterEndReturnsEOF() throws Exception {
+ public void testReadingFromAPositionAfterEndReturnsEOF() throws Exception {
try (SeekableByteChannel c = new SeekableInMemoryByteChannel()) {
c.position(2);
assertEquals(2, c.position());
@@ -65,7 +65,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldReadContentsProperly() throws IOException {
+ public void testShouldReadContentsProperly() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
final ByteBuffer readBuffer = ByteBuffer.allocate(testData.length);
@@ -79,7 +79,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldReadContentsWhenBiggerBufferSupplied() throws IOException {
+ public void testShouldReadContentsWhenBiggerBufferSupplied() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
final ByteBuffer readBuffer = ByteBuffer.allocate(testData.length + 1);
@@ -93,7 +93,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldReadDataFromSetPosition() throws IOException {
+ public void testShouldReadDataFromSetPosition() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
final ByteBuffer readBuffer = ByteBuffer.allocate(4);
@@ -108,7 +108,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldSetProperPosition() throws IOException {
+ public void testShouldSetProperPosition() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
// when
@@ -123,7 +123,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldSetProperPositionOnTruncate() throws IOException {
+ public void testShouldSetProperPositionOnTruncate() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
// when
@@ -136,7 +136,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldSignalEOFWhenPositionAtTheEnd() throws IOException {
+ public void testShouldSignalEOFWhenPositionAtTheEnd() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
final ByteBuffer readBuffer = ByteBuffer.allocate(testData.length);
@@ -151,7 +151,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldThrowExceptionOnReadingClosedChannel() {
+ public void testShouldThrowExceptionOnReadingClosedChannel() {
// given
final SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel();
// when
@@ -160,7 +160,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldThrowExceptionOnWritingToClosedChannel() {
+ public void testShouldThrowExceptionOnWritingToClosedChannel() {
// given
final SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel();
// when
@@ -169,7 +169,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldThrowExceptionWhenSettingIncorrectPosition() {
+ public void testShouldThrowExceptionWhenSettingIncorrectPosition() {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel()) {
// when
@@ -178,7 +178,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldThrowExceptionWhenTruncatingToIncorrectSize() {
+ public void testShouldThrowExceptionWhenTruncatingToIncorrectSize() {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel()) {
// when
@@ -187,7 +187,7 @@ public class SeekableInMemoryByteChannelTest {
}
@Test
- public void shouldTruncateContentsProperly() {
+ public void testShouldTruncateContentsProperly() {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
// when
@@ -203,7 +203,7 @@ public class SeekableInMemoryByteChannelTest {
// https://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html#close()
@Test
- public void shouldWriteDataProperly() throws IOException {
+ public void testShouldWriteDataProperly() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel()) {
final ByteBuffer inData = ByteBuffer.wrap(testData);
@@ -219,7 +219,7 @@ public class SeekableInMemoryByteChannelTest {
// https://docs.oracle.com/javase/7/docs/api/java/nio/channels/SeekableByteChannel.html#position()
@Test
- public void shouldWriteDataProperlyAfterPositionSet() throws IOException {
+ public void testShouldWriteDataProperlyAfterPositionSet() throws IOException {
// given
try (SeekableInMemoryByteChannel c = new SeekableInMemoryByteChannel(testData)) {
final ByteBuffer inData = ByteBuffer.wrap(testData);
diff --git a/src/test/java/org/apache/commons/compress/utils/SkipShieldingInputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/SkipShieldingInputStreamTest.java
index 75f80844..0b36565f 100644
--- a/src/test/java/org/apache/commons/compress/utils/SkipShieldingInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/SkipShieldingInputStreamTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
public class SkipShieldingInputStreamTest {
@Test
- public void skipDelegatesToRead() throws IOException {
+ public void testSkipDelegatesToRead() throws IOException {
try (InputStream i = new SkipShieldingInputStream(new InputStream() {
@Override
public int read() {
@@ -49,7 +49,7 @@ public class SkipShieldingInputStreamTest {
}
@Test
- public void skipHasAnUpperBoundOnRead() throws IOException {
+ public void testSkipHasAnUpperBoundOnRead() throws IOException {
try (InputStream i = new SkipShieldingInputStream(new InputStream() {
@Override
public int read() {
@@ -70,7 +70,7 @@ public class SkipShieldingInputStreamTest {
}
@Test
- public void skipSwallowsNegativeArguments() throws IOException {
+ public void testSkipSwallowsNegativeArguments() throws IOException {
try (InputStream i = new SkipShieldingInputStream(new InputStream() {
@Override
public int read() {
diff --git a/src/test/java/org/apache/commons/compress/utils/TimeUtilsTest.java b/src/test/java/org/apache/commons/compress/utils/TimeUtilsTest.java
index fc4039f1..21e4c23a 100644
--- a/src/test/java/org/apache/commons/compress/utils/TimeUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/TimeUtilsTest.java
@@ -125,7 +125,7 @@ public class TimeUtilsTest {
}
@Test
- public void shouldCheckWhetherTimeCanBeRepresentedAsUnixTime() {
+ public void testShouldCheckWhetherTimeCanBeRepresentedAsUnixTime() {
assertTrue(TimeUtils.isUnixTime(null));
assertTrue(TimeUtils.isUnixTime(FileTime.from(Instant.parse("2022-12-27T12:45:22Z"))));
assertTrue(TimeUtils.isUnixTime(FileTime.from(Instant.parse("2038-01-19T03:14:07Z"))));
@@ -194,12 +194,12 @@ public class TimeUtilsTest {
}
@Test
- public void shouldConvertNullDateToNullFileTime() {
+ public void testShouldConvertNullDateToNullFileTime() {
assertNull(toFileTime(null));
}
@Test
- public void shouldConvertNullFileTimeToNullDate() {
+ public void testShouldConvertNullFileTimeToNullDate() {
assertNull(toDate(null));
}
diff --git a/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java b/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java
index 9b090565..75ca89e6 100644
--- a/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/ZipSplitReadOnlySeekableByteChannelTest.java
@@ -40,13 +40,13 @@ import org.junit.jupiter.api.Test;
public class ZipSplitReadOnlySeekableByteChannelTest {
@Test
- public void buildFromLastSplitSegmentThrowsOnNotZipFile() throws IOException {
+ public void testBuildFromLastSplitSegmentThrowsOnNotZipFile() throws IOException {
final File lastFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
assertThrows(IllegalArgumentException.class, () -> ZipSplitReadOnlySeekableByteChannel.buildFromLastSplitSegment(lastFile));
}
@Test
- public void channelsPositionIsZeroAfterConstructor() throws IOException {
+ public void testChannelsPositionIsZeroAfterConstructor() throws IOException {
final List<SeekableByteChannel> channels = getSplitZipChannels();
new ZipSplitReadOnlySeekableByteChannel(channels);
for (final SeekableByteChannel channel : channels) {
@@ -55,7 +55,7 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void constructorThrowsOnNonSplitZipFiles() throws IOException {
+ public void testConstructorThrowsOnNonSplitZipFiles() throws IOException {
final List<SeekableByteChannel> channels = new ArrayList<>();
final File file = getFile("COMPRESS-189.zip");
channels.add(Files.newByteChannel(file.toPath(), StandardOpenOption.READ));
@@ -63,17 +63,17 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void constructorThrowsOnNullArg() {
+ public void testConstructorThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> new ZipSplitReadOnlySeekableByteChannel(null));
}
@Test
- public void forFilesOfTwoParametersThrowsOnNullArg() {
+ public void testForFilesOfTwoParametersThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> ZipSplitReadOnlySeekableByteChannel.forFiles(null, null));
}
@Test
- public void forFilesReturnCorrectClass() throws IOException {
+ public void testForFilesReturnCorrectClass() throws IOException {
final File firstFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
final File secondFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z02");
final File lastFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
@@ -92,17 +92,17 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void forFilesThrowsOnNullArg() {
+ public void testForFilesThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> ZipSplitReadOnlySeekableByteChannel.forFiles(null));
}
@Test
- public void forOrderedSeekableByteChannelsOfTwoParametersThrowsOnNullArg() {
+ public void testForOrderedSeekableByteChannelsOfTwoParametersThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(null, null));
}
@Test
- public void forOrderedSeekableByteChannelsReturnCorrectClass() throws IOException {
+ public void testForOrderedSeekableByteChannelsReturnCorrectClass() throws IOException {
final File file1 = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
final SeekableByteChannel firstChannel = Files.newByteChannel(file1.toPath(), StandardOpenOption.READ);
@@ -124,7 +124,7 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void forOrderedSeekableByteChannelsReturnsIdentityForSingleElement() throws IOException {
+ public void testForOrderedSeekableByteChannelsReturnsIdentityForSingleElement() throws IOException {
try (SeekableByteChannel emptyChannel = new SeekableInMemoryByteChannel(ByteUtils.EMPTY_BYTE_ARRAY);
final SeekableByteChannel channel = ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(emptyChannel)) {
assertSame(emptyChannel, channel);
@@ -132,17 +132,17 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void forOrderedSeekableByteChannelsThrowsOnNullArg() {
+ public void testForOrderedSeekableByteChannelsThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> ZipSplitReadOnlySeekableByteChannel.forOrderedSeekableByteChannels(null));
}
@Test
- public void forPathsOfTwoParametersThrowsOnNullArg() {
+ public void testForPathsOfTwoParametersThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> ZipSplitReadOnlySeekableByteChannel.forPaths(null, null));
}
@Test
- public void forPathsReturnCorrectClass() throws IOException {
+ public void testForPathsReturnCorrectClass() throws IOException {
final Path firstFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
final Path secondFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z02");
final Path lastFile = getPath("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.zip");
@@ -161,7 +161,7 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void forPathsThrowsOnNullArg() {
+ public void testForPathsThrowsOnNullArg() {
assertThrows(NullPointerException.class, () -> ZipSplitReadOnlySeekableByteChannel.forPaths(null));
}
@@ -180,7 +180,7 @@ public class ZipSplitReadOnlySeekableByteChannelTest {
}
@Test
- public void positionToSomeZipSplitSegment() throws IOException {
+ public void testPositionToSomeZipSplitSegment() throws IOException {
final File firstFile = getFile("COMPRESS-477/split_zip_created_by_zip/split_zip_created_by_zip.z01");
final int firstFileSize = (int) firstFile.length();