commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [1/2] commons-crypto git commit: CRYPTO-88: ConfigurationKeys constants could have much shorter names
Date Fri, 24 Jun 2016 08:36:17 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master e90580a89 -> 49a264718


CRYPTO-88: ConfigurationKeys constants could have much shorter names


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

Branch: refs/heads/master
Commit: 12988811376e69f88e1aec6ac45576c3678b0aa4
Parents: e90580a
Author: Sun Dapeng <sdp@apache.org>
Authored: Fri Jun 24 16:16:39 2016 +0800
Committer: Sun Dapeng <sdp@apache.org>
Committed: Fri Jun 24 16:16:39 2016 +0800

----------------------------------------------------------------------
 .../apache/commons/crypto/cipher/JceCipher.java |  6 ++--
 .../commons/crypto/conf/ConfigurationKeys.java  | 38 ++++++++++----------
 .../commons/crypto/examples/RandomExample.java  |  2 +-
 .../crypto/random/CryptoRandomFactory.java      |  8 ++---
 .../commons/crypto/random/JavaCryptoRandom.java |  4 +--
 .../commons/crypto/random/OsCryptoRandom.java   |  6 ++--
 .../org/apache/commons/crypto/utils/Utils.java  | 32 ++++++++---------
 .../crypto/cipher/AbstractCipherTest.java       |  2 +-
 .../crypto/cipher/CryptoCipherFactoryTest.java  | 11 +++---
 .../crypto/random/TestJavaCryptoRandom.java     |  2 +-
 .../crypto/random/TestOpensslCryptoRandom.java  |  2 +-
 11 files changed, 55 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java b/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java
index 7dcd606..6478e3c 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java
@@ -211,8 +211,8 @@ public class JceCipher implements CryptoCipher {
      * @return the jce provider based on the props.
      */
     private static String getJCEProvider(Properties props) {
-        return props.getProperty(ConfigurationKeys.COMMONS_CRYPTO_CIPHER_JCE_PROVIDER_KEY)
!=
-            null ? props.getProperty(ConfigurationKeys.COMMONS_CRYPTO_CIPHER_JCE_PROVIDER_KEY)
-            : System.getProperty(ConfigurationKeys.COMMONS_CRYPTO_CIPHER_JCE_PROVIDER_KEY);
+        return props.getProperty(ConfigurationKeys.CIPHER_JCE_PROVIDER_KEY) !=
+            null ? props.getProperty(ConfigurationKeys.CIPHER_JCE_PROVIDER_KEY)
+            : System.getProperty(ConfigurationKeys.CIPHER_JCE_PROVIDER_KEY);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
index d808f0d..580eff5 100644
--- a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
+++ b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
@@ -32,12 +32,12 @@ public class ConfigurationKeys {
     /**
      * The filename of configuration file.
      */
-    public static final String COMMONS_CRYPTO_SYSTEM_PROPERTIES_FILE = CONF_PREFIX
+    public static final String SYSTEM_PROPERTIES_FILE = CONF_PREFIX
             + "properties";
 
     /**
      * The configuration key of implementation class for crypto cipher. The
-     * values of COMMONS_CRYPTO_CIPHER_CLASSES_KEY can be
+     * values of CIPHER_CLASSES_KEY can be
      * "org.apache.commons.crypto.cipher.JceCipher" or
      * "org.apache.commons.crypto.cipher.OpensslCipher". Or it can be a comma
      * separated list. The "org.apache.commons.crypto.cipher.JceCipher" use jce
@@ -46,47 +46,47 @@ public class ConfigurationKeys {
      * implement. Note that for each value,the first value which can be created
      * without exception will be used (priority by order).
      */
-    public static final String COMMONS_CRYPTO_CIPHER_CLASSES_KEY = CONF_PREFIX
+    public static final String CIPHER_CLASSES_KEY = CONF_PREFIX
             + "cipher.classes";
 
     /**
      * The default value for crypto cipher.
      */
-    public static final String COMMONS_CRYPTO_CIPHER_CLASSES_DEFAULT = OpensslCipher.class
+    public static final String CIPHER_CLASSES_DEFAULT = OpensslCipher.class
             .getName();
 
     /**
      * The configuration key of the provider class for JCE cipher.
      */
-    public static final String COMMONS_CRYPTO_CIPHER_JCE_PROVIDER_KEY = CONF_PREFIX
+    public static final String CIPHER_JCE_PROVIDER_KEY = CONF_PREFIX
             + "cipher.jce.provider";
 
     // security random related configuration keys
     /**
      * The configuration key of the file path for secure random device.
      */
-    public static final String COMMONS_CRYPTO_SECURE_RANDOM_DEVICE_FILE_PATH_KEY = CONF_PREFIX
+    public static final String SECURE_RANDOM_DEVICE_FILE_PATH_KEY = CONF_PREFIX
             + "secure.random.device.file.path";
 
     /**
      * The default value of the file path for secure random device.
      */
-    public static final String COMMONS_CRYPTO_SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT = "/dev/urandom";
+    public static final String SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT = "/dev/urandom";
 
     /**
      * The configuration key of the algorithm of secure random.
      */
-    public static final String COMMONS_CRYPTO_SECURE_RANDOM_JAVA_ALGORITHM_KEY = CONF_PREFIX
+    public static final String SECURE_RANDOM_JAVA_ALGORITHM_KEY = CONF_PREFIX
             + "secure.random.java.algorithm";
 
     /**
      * The default value of the algorithm of secure random.
      */
-    public static final String COMMONS_CRYPTO_SECURE_RANDOM_JAVA_ALGORITHM_DEFAULT = "SHA1PRNG";
+    public static final String SECURE_RANDOM_JAVA_ALGORITHM_DEFAULT = "SHA1PRNG";
 
     /**
      * The configuration key of the implementation class for secure random. The
-     * values of COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY can be
+     * values of SECURE_RANDOM_CLASSES_KEY can be
      * "org.apache.commons.crypto.random.JavaCryptoRandom" or
      * "org.apache.commons.crypto.random.OpensslCryptoRandom". Or it takes a
      * comma separated list. The
@@ -96,52 +96,50 @@ public class ConfigurationKeys {
      * openssl to implement. Note that for each value,the first value which can
      * be created without exception will be used (priority by order).
      */
-    public static final String COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY = CONF_PREFIX
+    public static final String SECURE_RANDOM_CLASSES_KEY = CONF_PREFIX
             + "secure.random.classes";
 
     /**
      * The configuration key of the buffer size for stream.
      */
-    public static final String COMMONS_CRYPTO_STREAM_BUFFER_SIZE_KEY = CONF_PREFIX
+    public static final String STREAM_BUFFER_SIZE_KEY = CONF_PREFIX
             + "stream.buffer.size";
 
     // stream related configuration keys
     /**
      * The default value of the buffer size for stream.
      */
-    public static final int COMMONS_CRYPTO_STREAM_BUFFER_SIZE_DEFAULT = 8192;
+    public static final int STREAM_BUFFER_SIZE_DEFAULT = 8192;
 
     // native lib related configuration keys
     /**
      * The configuration key of the path for loading crypto library.
      */
-    public static final String COMMONS_CRYPTO_LIB_PATH_KEY = CONF_PREFIX
+    public static final String LIB_PATH_KEY = CONF_PREFIX
             + "lib.path";
 
     /**
      * The configuration key of the file name for loading crypto library.
      */
-    public static final String COMMONS_CRYPTO_LIB_NAME_KEY = CONF_PREFIX
+    public static final String LIB_NAME_KEY = CONF_PREFIX
             + "lib.name";
 
     /**
      * The configuration key of temp directory for extracting crypto library.
      */
-    public static final String COMMONS_CRYPTO_LIB_TEMPDIR_KEY = CONF_PREFIX
+    public static final String LIB_TEMPDIR_KEY = CONF_PREFIX
             + "lib.tempdir";
 
     /**
      * The configuration key of enable fallback on native failed.
      */
-    public static final String
-            COMMONS_CRYPTO_ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY = CONF_PREFIX +
+    public static final String ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY = CONF_PREFIX +
             "enable.fallback";
 
     /**
      * The default value of enable fallback on native failed.
      */
-    public static final boolean
-            COMMONS_CRYPTO_ENABLE_FALLBACK_ON_NATIVE_FAILED_DEFAULT = true;
+    public static final boolean ENABLE_FALLBACK_ON_NATIVE_FAILED_DEFAULT = true;
 
     /**
      * The private constructor of {@Link ConfigurationKeys}.

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/examples/RandomExample.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/examples/RandomExample.java b/src/main/java/org/apache/commons/crypto/examples/RandomExample.java
index 09f6ea3..a350d7f 100644
--- a/src/main/java/org/apache/commons/crypto/examples/RandomExample.java
+++ b/src/main/java/org/apache/commons/crypto/examples/RandomExample.java
@@ -33,7 +33,7 @@ public class RandomExample {
         byte[] key = new byte[16];
         byte[] iv = new byte[16];
         Properties properties = new Properties();
-        properties.put(ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY,
+        properties.put(ConfigurationKeys.SECURE_RANDOM_CLASSES_KEY,
                 "org.apache.commons.crypto.random.OpensslCryptoRandom"); // TODO replace
with alias
         //Gets the 'CryptoRandom' instance.
         CryptoRandom random = CryptoRandomFactory.getCryptoRandom(properties);

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java b/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java
index a9d0ce2..4becf83 100644
--- a/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java
+++ b/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java
@@ -22,7 +22,7 @@ import java.util.Properties;
 
 import org.apache.commons.crypto.utils.ReflectionUtils;
 import org.apache.commons.crypto.utils.Utils;
-import static org.apache.commons.crypto.conf.ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY;
+import static org.apache.commons.crypto.conf.ConfigurationKeys.SECURE_RANDOM_CLASSES_KEY;
 
 /**
  * This is the factory class used for {@link CryptoRandom}.
@@ -37,7 +37,7 @@ public class CryptoRandomFactory {
 
     /**
      * Gets a CryptoRandom instance for specified props.
-     * Uses the COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY from the provided 
+     * Uses the SECURE_RANDOM_CLASSES_KEY from the provided
      * properties.
      * If it is not set, then it checks the System properties.
      * Failing that, it defaults to {@link JavaCryptoRandom}
@@ -52,10 +52,10 @@ public class CryptoRandomFactory {
     public static CryptoRandom getCryptoRandom(Properties props)
             throws GeneralSecurityException {
         String cryptoRandomClasses = props
-                .getProperty(COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY);
+                .getProperty(SECURE_RANDOM_CLASSES_KEY);
         if (cryptoRandomClasses == null) {
             cryptoRandomClasses = System
-                    .getProperty(COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY);
+                    .getProperty(SECURE_RANDOM_CLASSES_KEY);
         }
 
         StringBuilder errorMessage = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java b/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
index 390f381..210c181 100644
--- a/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/random/JavaCryptoRandom.java
@@ -42,8 +42,8 @@ public class JavaCryptoRandom implements CryptoRandom {
         instance = SecureRandom
                 .getInstance(properties
                         .getProperty(
-                                ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_JAVA_ALGORITHM_KEY,
-                                ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_JAVA_ALGORITHM_DEFAULT));
+                                ConfigurationKeys.SECURE_RANDOM_JAVA_ALGORITHM_KEY,
+                                ConfigurationKeys.SECURE_RANDOM_JAVA_ALGORITHM_DEFAULT));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java b/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java
index d105e56..feb1f5b 100644
--- a/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java
@@ -142,11 +142,11 @@ public class OsCryptoRandom extends Random implements CryptoRandom {
      */
     private static String getRandomDevPath(Properties props) {
         String devPath = props
-            .getProperty(ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_DEVICE_FILE_PATH_KEY);
+            .getProperty(ConfigurationKeys.SECURE_RANDOM_DEVICE_FILE_PATH_KEY);
         if (devPath == null) {
             devPath = System.getProperty(
-                ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_DEVICE_FILE_PATH_KEY,
-                ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT);
+                ConfigurationKeys.SECURE_RANDOM_DEVICE_FILE_PATH_KEY,
+                ConfigurationKeys.SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT);
         }
         return devPath;
     }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/main/java/org/apache/commons/crypto/utils/Utils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/utils/Utils.java b/src/main/java/org/apache/commons/crypto/utils/Utils.java
index fc1896d..79045bd 100644
--- a/src/main/java/org/apache/commons/crypto/utils/Utils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/Utils.java
@@ -58,12 +58,12 @@ public final class Utils {
 
     /**
      * loads system properties when configuration file of the name
-     * {@link ConfigurationKeys#COMMONS_CRYPTO_SYSTEM_PROPERTIES_FILE} is found.
+     * {@link ConfigurationKeys#SYSTEM_PROPERTIES_FILE} is found.
      */
     private static void loadSystemProperties() {
         try {
             InputStream is = Thread.currentThread().getContextClassLoader()
-                    .getResourceAsStream(ConfigurationKeys.COMMONS_CRYPTO_SYSTEM_PROPERTIES_FILE);
+                    .getResourceAsStream(ConfigurationKeys.SYSTEM_PROPERTIES_FILE);
 
             if (is == null) {
                 return; // no configuration file is found
@@ -81,7 +81,7 @@ public final class Utils {
             }
         } catch (Throwable ex) {
             System.err.println("Could not load '"
-                    + ConfigurationKeys.COMMONS_CRYPTO_SYSTEM_PROPERTIES_FILE
+                    + ConfigurationKeys.SYSTEM_PROPERTIES_FILE
                     + "' from classpath: " + ex.toString());
         }
     }
@@ -125,13 +125,13 @@ public final class Utils {
      * */
     public static int getBufferSize(Properties props) {
         String bufferSizeStr = props
-                .getProperty(ConfigurationKeys.COMMONS_CRYPTO_STREAM_BUFFER_SIZE_KEY);
+                .getProperty(ConfigurationKeys.STREAM_BUFFER_SIZE_KEY);
         if (bufferSizeStr == null || bufferSizeStr.isEmpty()) {
             bufferSizeStr = System
-                    .getProperty(ConfigurationKeys.COMMONS_CRYPTO_STREAM_BUFFER_SIZE_KEY);
+                    .getProperty(ConfigurationKeys.STREAM_BUFFER_SIZE_KEY);
         }
         if (bufferSizeStr == null || bufferSizeStr.isEmpty()) {
-            return ConfigurationKeys.COMMONS_CRYPTO_STREAM_BUFFER_SIZE_DEFAULT;
+            return ConfigurationKeys.STREAM_BUFFER_SIZE_DEFAULT;
         }
         return Integer.parseInt(bufferSizeStr);
     }
@@ -144,13 +144,13 @@ public final class Utils {
      * @return the cipher class based on the props.
      */
     public static String getCipherClassString(Properties props) {
-        final String configName = ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_KEY;
+        final String configName = ConfigurationKeys.CIPHER_CLASSES_KEY;
         String cipherClassString = props.getProperty(configName) != null ? props
-                .getProperty(configName, ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_DEFAULT)
+                .getProperty(configName, ConfigurationKeys.CIPHER_CLASSES_DEFAULT)
                 : System.getProperty(configName,
-                ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_DEFAULT);
+                ConfigurationKeys.CIPHER_CLASSES_DEFAULT);
         if (cipherClassString.isEmpty()) {
-            cipherClassString = ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_DEFAULT;
+            cipherClassString = ConfigurationKeys.CIPHER_CLASSES_DEFAULT;
         }
         return cipherClassString;
     }
@@ -161,7 +161,7 @@ public final class Utils {
      * @return the path of native library.
      */
     public static String getLibPath() {
-        return System.getProperty(ConfigurationKeys.COMMONS_CRYPTO_LIB_PATH_KEY);
+        return System.getProperty(ConfigurationKeys.LIB_PATH_KEY);
     }
 
     /**
@@ -170,7 +170,7 @@ public final class Utils {
      * @return the file name of native library.
      */
     public static String getLibName() {
-        return System.getProperty(ConfigurationKeys.COMMONS_CRYPTO_LIB_NAME_KEY);
+        return System.getProperty(ConfigurationKeys.LIB_NAME_KEY);
     }
 
     /**
@@ -179,7 +179,7 @@ public final class Utils {
      * @return the temp directory.
      */
     public static String getTmpDir() {
-        return System.getProperty(ConfigurationKeys.COMMONS_CRYPTO_LIB_TEMPDIR_KEY,
+        return System.getProperty(ConfigurationKeys.LIB_TEMPDIR_KEY,
                 System.getProperty("java.io.tmpdir"));
     }
 
@@ -364,14 +364,14 @@ public final class Utils {
      */
     public static boolean isFallbackEnabled(Properties props) {
         String enableFallback = props.getProperty(ConfigurationKeys.
-                COMMONS_CRYPTO_ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY);
+            ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY);
         if (enableFallback == null || enableFallback.isEmpty()) {
             enableFallback = System.getProperty(ConfigurationKeys.
-                    COMMONS_CRYPTO_ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY);
+                ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY);
         }
         if (enableFallback == null || enableFallback.isEmpty()) {
             return ConfigurationKeys
-                    .COMMONS_CRYPTO_ENABLE_FALLBACK_ON_NATIVE_FAILED_DEFAULT;
+                    .ENABLE_FALLBACK_ON_NATIVE_FAILED_DEFAULT;
         }
         return Boolean.valueOf(enableFallback);
     }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
index ee69a06..07fc53e 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
@@ -57,7 +57,7 @@ public abstract class AbstractCipherTest {
         Utils.checkNotNull(cipherClass);
         Utils.checkNotNull(transformations);
         props = new Properties();
-        props.setProperty(ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_KEY,
+        props.setProperty(ConfigurationKeys.CIPHER_CLASSES_KEY,
                 cipherClass);
     }
 

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java b/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
index 0adf826..1776b4c 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
@@ -38,7 +38,7 @@ public class CryptoCipherFactoryTest {
     public void testEmptyCipher() throws GeneralSecurityException {
         Properties properties = new Properties();
         properties.setProperty(
-                ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_KEY, "");
+                ConfigurationKeys.CIPHER_CLASSES_KEY, "");
         CryptoCipher defaultCipher = CryptoCipherFactory.getInstance(
                 "AES/CBC/NoPadding", properties);
         Assert.assertEquals(OpensslCipher.class.getName(), defaultCipher
@@ -48,7 +48,7 @@ public class CryptoCipherFactoryTest {
     @Test
     public void testInvalidCipher() throws GeneralSecurityException {
         Properties properties = new Properties();
-        properties.setProperty(ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_KEY,
+        properties.setProperty(ConfigurationKeys.CIPHER_CLASSES_KEY,
                 "InvalidCipherName");
         CryptoCipher defaultCipher = CryptoCipherFactory.getInstance(
                 "AES/CBC/NoPadding", properties);
@@ -59,11 +59,10 @@ public class CryptoCipherFactoryTest {
     @Test(expected = GeneralSecurityException.class)
     public void testDisableFallback() throws GeneralSecurityException {
         Properties properties = new Properties();
-        properties.setProperty(
-                ConfigurationKeys.COMMONS_CRYPTO_CIPHER_CLASSES_KEY,
-                "InvalidCipherName");
+        properties.setProperty(ConfigurationKeys.CIPHER_CLASSES_KEY,
+            "InvalidCipherName");
         properties.setProperty(ConfigurationKeys
-            .COMMONS_CRYPTO_ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY, "false");
+            .ENABLE_FALLBACK_ON_NATIVE_FAILED_KEY, "false");
 
         CryptoCipherFactory.getInstance("AES/CBC/NoPadding", properties);
     }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/test/java/org/apache/commons/crypto/random/TestJavaCryptoRandom.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/random/TestJavaCryptoRandom.java b/src/test/java/org/apache/commons/crypto/random/TestJavaCryptoRandom.java
index e8080bd..ba2681f 100644
--- a/src/test/java/org/apache/commons/crypto/random/TestJavaCryptoRandom.java
+++ b/src/test/java/org/apache/commons/crypto/random/TestJavaCryptoRandom.java
@@ -29,7 +29,7 @@ public class TestJavaCryptoRandom extends AbstractRandomTest {
     public CryptoRandom getCryptoRandom() throws GeneralSecurityException {
         Properties props = new Properties();
         props.setProperty(
-                ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY,
+                ConfigurationKeys.SECURE_RANDOM_CLASSES_KEY,
                 JavaCryptoRandom.class.getName());
         CryptoRandom random = CryptoRandomFactory.getCryptoRandom(props);
         if (!(random instanceof JavaCryptoRandom)) {

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/12988811/src/test/java/org/apache/commons/crypto/random/TestOpensslCryptoRandom.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/random/TestOpensslCryptoRandom.java b/src/test/java/org/apache/commons/crypto/random/TestOpensslCryptoRandom.java
index c14c6f4..f6d587d 100644
--- a/src/test/java/org/apache/commons/crypto/random/TestOpensslCryptoRandom.java
+++ b/src/test/java/org/apache/commons/crypto/random/TestOpensslCryptoRandom.java
@@ -29,7 +29,7 @@ public class TestOpensslCryptoRandom extends AbstractRandomTest {
     public CryptoRandom getCryptoRandom() throws GeneralSecurityException {
         Properties props = new Properties();
         props.setProperty(
-                ConfigurationKeys.COMMONS_CRYPTO_SECURE_RANDOM_CLASSES_KEY,
+                ConfigurationKeys.SECURE_RANDOM_CLASSES_KEY,
                 OpensslCryptoRandom.class.getName());
         CryptoRandom random = CryptoRandomFactory.getCryptoRandom(props);
         if (!(random instanceof OpensslCryptoRandom)) {


Mime
View raw message