commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherb...@apache.org
Subject [commons-collections] 04/06: Test getProvider() is Apache Commons Collections.
Date Tue, 18 Feb 2020 16:36:34 GMT
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git

commit 4ecffb5feeb308adcf070a14c47d38e66b8a7602
Author: aherbert <a.herbert@sussex.ac.uk>
AuthorDate: Tue Feb 18 13:47:24 2020 +0000

    Test getProvider() is Apache Commons Collections.
---
 .../commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java    | 3 ++-
 .../collections4/bloomfilter/hasher/function/MD5CyclicTest.java        | 1 +
 .../bloomfilter/hasher/function/Murmur128x86CyclicTest.java            | 1 +
 .../bloomfilter/hasher/function/Murmur32x86IterativeTest.java          | 1 +
 .../bloomfilter/hasher/function/ObjectsHashIterativeTest.java          | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java
b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java
index d2aeb49..f6d4e59 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5Cyclic.java
@@ -59,7 +59,8 @@ public final class MD5Cyclic implements HashFunction {
         try {
             messageDigest = MessageDigest.getInstance(NAME);
         } catch (final NoSuchAlgorithmException e) {
-            throw new IllegalStateException(e.getMessage());
+            // This should not happen
+            throw new IllegalStateException("Missing the standard MD5 message digest algorithm",
e);
         }
         signature = apply(HashFunctionIdentity.prepareSignatureBuffer(this), 0);
     }
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5CyclicTest.java
b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5CyclicTest.java
index d82ea8a..069a299 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5CyclicTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/MD5CyclicTest.java
@@ -58,5 +58,6 @@ public class MD5CyclicTest {
             md5.getProcessType());
         final long expected = md5.apply(arg.getBytes(StandardCharsets.UTF_8), 0);
         assertEquals(expected, md5.getSignature());
+        assertEquals("Apache Commons Collections", md5.getProvider());
     }
 }
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86CyclicTest.java
b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86CyclicTest.java
index 35fc1c7..d318b9c 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86CyclicTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur128x86CyclicTest.java
@@ -60,5 +60,6 @@ public class Murmur128x86CyclicTest {
             murmur.getProcessType());
         final long expected = murmur.apply(arg.getBytes(StandardCharsets.UTF_8), 0);
         assertEquals(expected, murmur.getSignature());
+        assertEquals("Apache Commons Collections", murmur.getProvider());
     }
 }
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86IterativeTest.java
b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86IterativeTest.java
index efe6da2..daf511a 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86IterativeTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/Murmur32x86IterativeTest.java
@@ -58,5 +58,6 @@ public class Murmur32x86IterativeTest {
             murmur.getProcessType());
         final long expected = murmur.apply(arg.getBytes(StandardCharsets.UTF_8), 0);
         assertEquals(expected, murmur.getSignature());
+        assertEquals("Apache Commons Collections", murmur.getProvider());
     }
 }
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterativeTest.java
b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterativeTest.java
index 4df7f75..1f7224d 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterativeTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/function/ObjectsHashIterativeTest.java
@@ -63,5 +63,6 @@ public class ObjectsHashIterativeTest {
         final long expected2 = obj.apply(arg.getBytes(StandardCharsets.UTF_8), 0);
         assertEquals(expected, expected2);
         assertEquals(expected, obj.getSignature());
+        assertEquals("Apache Commons Collections", obj.getProvider());
     }
 }


Mime
View raw message