You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by sd...@apache.org on 2016/06/21 02:10:28 UTC

commons-crypto git commit: CRYPTO-76: Remove log dependence (test)

Repository: commons-crypto
Updated Branches:
  refs/heads/master e4156dafc -> aef15f417


CRYPTO-76: Remove log dependence (test)


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

Branch: refs/heads/master
Commit: aef15f417882fca19219e7665fc95a4e268bbeb6
Parents: e4156da
Author: Sun Dapeng <sd...@apache.org>
Authored: Tue Jun 21 09:36:00 2016 +0800
Committer: Sun Dapeng <sd...@apache.org>
Committed: Tue Jun 21 09:59:06 2016 +0800

----------------------------------------------------------------------
 pom.xml                                         | 18 ------------
 .../crypto/stream/AbstractCipherStreamTest.java | 29 ++++++++------------
 2 files changed, 11 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/aef15f41/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4529a5f..1175364 100644
--- a/pom.xml
+++ b/pom.xml
@@ -494,23 +494,5 @@ The following provides more details on the included cryptographic software:
       <version>${junit.version}</version>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>${commons-logging.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <version>${slf4j-api.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <version>${slf4j-api.version}</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/aef15f41/src/test/java/org/apache/commons/crypto/stream/AbstractCipherStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/stream/AbstractCipherStreamTest.java b/src/test/java/org/apache/commons/crypto/stream/AbstractCipherStreamTest.java
index 1a494db..c055616 100644
--- a/src/test/java/org/apache/commons/crypto/stream/AbstractCipherStreamTest.java
+++ b/src/test/java/org/apache/commons/crypto/stream/AbstractCipherStreamTest.java
@@ -30,22 +30,19 @@ import java.nio.channels.ReadableByteChannel;
 import java.security.SecureRandom;
 import java.util.Properties;
 import java.util.Random;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
 
-import org.apache.commons.crypto.cipher.*;
+import org.apache.commons.crypto.cipher.CipherTransformation;
 import org.apache.commons.crypto.cipher.CryptoCipher;
+import org.apache.commons.crypto.cipher.JceCipher;
+import org.apache.commons.crypto.cipher.OpensslCipher;
 import org.apache.commons.crypto.utils.ReflectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-
 public abstract class AbstractCipherStreamTest {
-    private static final Log LOG = LogFactory
-            .getLog(AbstractCipherStreamTest.class);
 
     private final int dataLen = 20000;
     private byte[] data = new byte[dataLen];
@@ -339,15 +336,14 @@ public abstract class AbstractCipherStreamTest {
     private void doReadWriteTestForInputStream(int count,
             String encCipherClass, String decCipherClass, byte[] iv)
             throws IOException {
+        // Created a cipher object of type encCipherClass;
         CryptoCipher encCipher = getCipher(encCipherClass);
-        LOG.debug("Created a cipher object of type: " + encCipherClass);
 
         // Generate data
         SecureRandom random = new SecureRandom();
         byte[] originalData = new byte[count];
         byte[] decryptedData = new byte[count];
         random.nextBytes(originalData);
-        LOG.debug("Generated " + count + " records");
 
         // Encrypt data
         ByteArrayOutputStream encryptedData = new ByteArrayOutputStream();
@@ -356,10 +352,9 @@ public abstract class AbstractCipherStreamTest {
         out.write(originalData, 0, originalData.length);
         out.flush();
         out.close();
-        LOG.debug("Finished encrypting data");
 
+        // Created a cipher object of type decCipherClass;
         CryptoCipher decCipher = getCipher(decCipherClass);
-        LOG.debug("Created a cipher object of type: " + decCipherClass);
 
         // Decrypt data
         CryptoInputStream in = getCryptoInputStream(new ByteArrayInputStream(
@@ -396,21 +391,20 @@ public abstract class AbstractCipherStreamTest {
                     expected, in.read());
         } while (expected != -1);
 
-        LOG.debug("SUCCESS! Completed checking " + count + " records");
+        // Completed checking records;
     }
 
     private void doReadWriteTestForReadableByteChannel(int count,
             String encCipherClass, String decCipherClass, byte[] iv)
             throws IOException {
+        // Creates a cipher object of type encCipherClass;
         CryptoCipher encCipher = getCipher(encCipherClass);
-        LOG.debug("Created a cipher object of type: " + encCipherClass);
 
         // Generate data
         SecureRandom random = new SecureRandom();
         byte[] originalData = new byte[count];
         byte[] decryptedData = new byte[count];
         random.nextBytes(originalData);
-        LOG.debug("Generated " + count + " records");
 
         // Encrypt data
         ByteArrayOutputStream encryptedData = new ByteArrayOutputStream();
@@ -419,10 +413,9 @@ public abstract class AbstractCipherStreamTest {
         out.write(originalData, 0, originalData.length);
         out.flush();
         out.close();
-        LOG.debug("Finished encrypting data");
 
+        // Creates a cipher object of type decCipherClass
         CryptoCipher decCipher = getCipher(decCipherClass);
-        LOG.debug("Created a cipher object of type: " + decCipherClass);
 
         // Decrypt data
         CryptoInputStream in = getCryptoInputStream(new ByteArrayInputStream(
@@ -459,6 +452,6 @@ public abstract class AbstractCipherStreamTest {
                     expected, in.read());
         } while (expected != -1);
 
-        LOG.debug("SUCCESS! Completed checking " + count + " records");
+        // Completed checking records
     }
 }