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
The following commit(s) were added to refs/heads/master by this push:
new 7326b6836 Sort members
7326b6836 is described below
commit 7326b6836cb28f23f9c620cc64cc65364d7e943e
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Nov 28 08:06:57 2023 -0500
Sort members
---
.../archivers/dump/DumpArchiveInputStreamTest.java | 32 +++++++++++-----------
.../archivers/dump/DumpArchiveUtilTest.java | 8 +++---
2 files changed, 20 insertions(+), 20 deletions(-)
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 d04e832e5..e8330ab26 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
@@ -49,6 +49,22 @@ public class DumpArchiveInputStreamTest extends AbstractTest
{
}
}
+ @Test
+ public void testDirectoryNullBytes() throws Exception {
+ try (InputStream is =
newInputStream("org/apache/commons/compress/dump/directory_null_bytes.dump");
+ DumpArchiveInputStream archive = new DumpArchiveInputStream(is)) {
+ assertThrows(InvalidFormatException.class, archive::getNextEntry);
+ }
+ }
+
+ @Test
+ public void testInvalidCompressType() throws Exception {
+ try (InputStream is =
newInputStream("org/apache/commons/compress/dump/invalid_compression_type.dump"))
{
+ final ArchiveException ex = assertThrows(ArchiveException.class,
() -> new DumpArchiveInputStream(is).close());
+ assertInstanceOf(UnsupportedCompressionAlgorithmException.class,
ex.getCause());
+ }
+ }
+
@Test
public void testMultiByteReadConsistentlyReturnsMinusOneAtEof() throws
Exception {
final byte[] buf = new byte[2];
@@ -88,20 +104,4 @@ public class DumpArchiveInputStreamTest extends
AbstractTest {
}
}
- @Test
- public void testDirectoryNullBytes() throws Exception {
- try (InputStream is =
newInputStream("org/apache/commons/compress/dump/directory_null_bytes.dump");
- DumpArchiveInputStream archive = new DumpArchiveInputStream(is)) {
- assertThrows(InvalidFormatException.class, archive::getNextEntry);
- }
- }
-
- @Test
- public void testInvalidCompressType() throws Exception {
- try (InputStream is =
newInputStream("org/apache/commons/compress/dump/invalid_compression_type.dump"))
{
- final ArchiveException ex = assertThrows(ArchiveException.class,
() -> new DumpArchiveInputStream(is).close());
- assertInstanceOf(UnsupportedCompressionAlgorithmException.class,
ex.getCause());
- }
- }
-
}
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 ae829059d..2ca5a7049 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
@@ -49,13 +49,13 @@ public class DumpArchiveUtilTest {
}
@Test
- public void testVerifyNullArgument() {
- assertFalse(DumpArchiveUtil.verify(null));
+ public void testVerifyNoMagic() {
+ assertFalse(DumpArchiveUtil.verify(new byte[32]));
}
@Test
- public void testVerifyNoMagic() {
- assertFalse(DumpArchiveUtil.verify(new byte[32]));
+ public void testVerifyNullArgument() {
+ assertFalse(DumpArchiveUtil.verify(null));
}
}