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 2022/05/05 19:48:50 UTC

[commons-compress] branch master updated (021fc07e -> 662bebbc)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


    from 021fc07e Fix broken tests.
     new 9c9c28e5 Whitespeace.
     new 662bebbc Fix broken tests.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../utils/ChecksumVerifyingInputStreamTest.java    | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)


[commons-compress] 02/02: Fix broken tests.

Posted by gg...@apache.org.
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 662bebbc0a2deb3602bc857253b4180bc31ea645
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 5 15:48:46 2022 -0400

    Fix broken tests.
---
 .../commons/compress/utils/ChecksumVerifyingInputStreamTest.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java
index e817624c..96c60013 100644
--- a/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java
@@ -25,6 +25,7 @@ import java.util.zip.CRC32;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
 
 /**
  * Unit tests for class {@link ChecksumVerifyingInputStream org.apache.commons.compress.utils.ChecksumVerifyingInputStream}.
@@ -40,7 +41,7 @@ public class ChecksumVerifyingInputStreamTest {
         final byte[] byteArray = new byte[3];
         final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
         final ChecksumVerifyingInputStream checksumVerifyingInputStream = new ChecksumVerifyingInputStream(adler32, byteArrayInputStream, (-1859L), (byte) (-68));
-        checksumVerifyingInputStream.read(byteArray);
+        assertThrows(IOException.class, () -> checksumVerifyingInputStream.read(byteArray));
     }
 
     @Test
@@ -49,7 +50,7 @@ public class ChecksumVerifyingInputStreamTest {
         final byte[] byteArray = new byte[9];
         final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
         final ChecksumVerifyingInputStream checksumVerifyingInputStream = new ChecksumVerifyingInputStream(cRC32_, byteArrayInputStream, (byte)1, (byte)1);
-        checksumVerifyingInputStream.read();
+        assertThrows(IOException.class, () -> checksumVerifyingInputStream.read());
     }
 
     @Test


[commons-compress] 01/02: Whitespeace.

Posted by gg...@apache.org.
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 9c9c28e5eb8e7f296d26642e84d6efd3dfe7833f
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 5 15:47:58 2022 -0400

    Whitespeace.
---
 .../utils/ChecksumVerifyingInputStreamTest.java         | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java b/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java
index 980b7a0c..e817624c 100644
--- a/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/utils/ChecksumVerifyingInputStreamTest.java
@@ -34,53 +34,36 @@ import static org.junit.Assert.assertEquals;
  **/
 public class ChecksumVerifyingInputStreamTest {
 
-
-
     @Test
     public void testReadTakingByteArrayThrowsIOException() throws IOException {
-
         final Adler32 adler32 = new Adler32();
         final byte[] byteArray = new byte[3];
         final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
         final ChecksumVerifyingInputStream checksumVerifyingInputStream = new ChecksumVerifyingInputStream(adler32, byteArrayInputStream, (-1859L), (byte) (-68));
-
         checksumVerifyingInputStream.read(byteArray);
-
     }
 
-
     @Test
     public void testReadTakingNoArgumentsThrowsIOException() throws IOException {
-
         final CRC32 cRC32_ = new CRC32();
         final byte[] byteArray = new byte[9];
         final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
         final ChecksumVerifyingInputStream checksumVerifyingInputStream = new ChecksumVerifyingInputStream(cRC32_, byteArrayInputStream, (byte)1, (byte)1);
-
         checksumVerifyingInputStream.read();
-
     }
 
-
     @Test
     public void testSkip() throws IOException {
-
         final CRC32 cRC32_ = new CRC32();
         final byte[] byteArray = new byte[4];
         final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
         final ChecksumVerifyingInputStream checksumVerifyingInputStream = new ChecksumVerifyingInputStream(cRC32_, byteArrayInputStream, (byte)33, 2303L);
         final int intOne = checksumVerifyingInputStream.read(byteArray);
-
         final long skipReturnValue = checksumVerifyingInputStream.skip((byte)1);
-
         assertEquals(558161692L, cRC32_.getValue());
         assertEquals(0, byteArrayInputStream.available());
-
         assertArrayEquals(new byte[] {(byte)0, (byte)0, (byte)0, (byte)0}, byteArray);
         assertEquals(0L, skipReturnValue);
-
     }
 
-
-
 }
\ No newline at end of file