commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject commons-crypto git commit: Allow test to work if JNI does not load
Date Wed, 06 Jul 2016 20:57:03 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master 1ef0752c4 -> 670b462be


Allow test to work if JNI does not load

Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/670b462b
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/670b462b
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/670b462b

Branch: refs/heads/master
Commit: 670b462be96d1b78d5ddcac3fb2b05a70a4444a5
Parents: 1ef0752
Author: Sebb <sebb@apache.org>
Authored: Wed Jul 6 21:56:59 2016 +0100
Committer: Sebb <sebb@apache.org>
Committed: Wed Jul 6 21:56:59 2016 +0100

----------------------------------------------------------------------
 .../commons/crypto/random/CryptoRandomFactoryTest.java       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/670b462b/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java b/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
index 0d93aeb..1c70285 100644
--- a/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
+++ b/src/test/java/org/apache/commons/crypto/random/CryptoRandomFactoryTest.java
@@ -42,8 +42,12 @@ public class CryptoRandomFactoryTest {
     public void testDefaultRandom() throws GeneralSecurityException {
         Properties props = new Properties();
         CryptoRandom random = CryptoRandomFactory.getCryptoRandom(props);
-        Assert.assertEquals(OpenSslCryptoRandom.class.getName(),
-            random.getClass().getName());
+        final String name = random.getClass().getName();
+        if (OpenSslCryptoRandom.isNativeCodeEnabled()) {
+            Assert.assertEquals(OpenSslCryptoRandom.class.getName(), name);
+        } else {
+            Assert.assertEquals(JavaCryptoRandom.class.getName(), name);
+        }
     }
 
     @Test


Mime
View raw message