You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2016/06/30 00:53:45 UTC
commons-crypto git commit: Initial test of enums
Repository: commons-crypto
Updated Branches:
refs/heads/master 6367ae4d6 -> 99cae9863
Initial test of enums
Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/99cae986
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/99cae986
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/99cae986
Branch: refs/heads/master
Commit: 99cae9863a4159e4cd2cb9df885b197d49f14f35
Parents: 6367ae4
Author: Sebb <se...@apache.org>
Authored: Thu Jun 30 01:53:42 2016 +0100
Committer: Sebb <se...@apache.org>
Committed: Thu Jun 30 01:53:42 2016 +0100
----------------------------------------------------------------------
.../apache/commons/crypto/utils/EnumTest.java | 47 ++++++++++++++++++++
1 file changed, 47 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/99cae986/src/test/java/org/apache/commons/crypto/utils/EnumTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/utils/EnumTest.java b/src/test/java/org/apache/commons/crypto/utils/EnumTest.java
new file mode 100644
index 0000000..336ae26
--- /dev/null
+++ b/src/test/java/org/apache/commons/crypto/utils/EnumTest.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.crypto.utils;
+
+import org.apache.commons.crypto.cipher.CryptoCipherFactory;
+import org.apache.commons.crypto.cipher.CryptoCipherFactory.CipherProvider;
+import org.apache.commons.crypto.random.CryptoRandomFactory;
+import org.apache.commons.crypto.random.CryptoRandomFactory.RandomProvider;
+import org.junit.Test;
+
+/**
+ * Test the enums used to define the internal implementation classes
+ */
+public class EnumTest {
+
+ @Test
+ public void testRandom() throws Exception {
+ for(RandomProvider value : CryptoRandomFactory.RandomProvider.values()) {
+ ReflectionUtils.getClassByName(value.getClassName());
+ }
+ }
+
+ @Test
+ public void testCipher() throws Exception {
+ for(CipherProvider value : CryptoCipherFactory.CipherProvider.values()) {
+ ReflectionUtils.getClassByName(value.getClassName());
+ }
+ }
+
+ // TODO check if any implementations of CryptoRandom or CryptoCipher are missing from the values
+
+}