You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/11/30 08:01:10 UTC

[GitHub] [commons-codec] aherbert commented on a change in pull request #31: Added non-blocking File digest methods

aherbert commented on a change in pull request #31: Added non-blocking File digest methods
URL: https://github.com/apache/commons-codec/pull/31#discussion_r352272387
 
 

 ##########
 File path: src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
 ##########
 @@ -146,6 +151,22 @@ public void testDigestFile() throws IOException {
         Assert.assertArrayEquals(digestTestData(), DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm),getTestFile()));
     }
 
+    @Test
+    public void testNonBlockingDigestRandomAccessFile() throws IOException {
+        Assume.assumeTrue(DigestUtils.isAvailable(messageDigestAlgorithm));
+        Assert.assertArrayEquals(digestTestData(),
+                DigestUtils.nonblockingDigest(DigestUtils.getDigest(messageDigestAlgorithm), getTestRandomAccessFile()));
+        Assert.assertArrayEquals(digestTestData(), DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm),getTestFile()));
 
 Review comment:
   This should call `nonblockingDigest` with `getTestRandomAccessFile()`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services