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:30:26 UTC

commons-crypto git commit: Document why not using try with resources

Repository: commons-crypto
Updated Branches:
  refs/heads/master 1535b5391 -> 6a544edcf


Document why not using try with resources

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

Branch: refs/heads/master
Commit: 6a544edcfa2c5db6f7e344e3fb37c3244d2662e2
Parents: 1535b53
Author: Sebb <se...@apache.org>
Authored: Thu Jun 30 01:30:22 2016 +0100
Committer: Sebb <se...@apache.org>
Committed: Thu Jun 30 01:30:22 2016 +0100

----------------------------------------------------------------------
 .../org/apache/commons/crypto/cipher/AbstractCipherTest.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6a544edc/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 affca80..8c84ef7 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
@@ -75,12 +75,14 @@ public abstract class AbstractCipherTest {
 
     @Test
     public void closeTestNoInit() throws Exception {
+        // This test deliberately does not use try with resources in order to control the sequence of operations exactly
         CryptoCipher enc = getCipher(transformations[0]);
         enc.close();
     }
 
     @Test
     public void closeTestAfterInit() throws Exception {
+        // This test deliberately does not use try with resources in order to control the sequence of operations exactly
         CryptoCipher enc = getCipher(transformations[0]);
         enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
         enc.close();
@@ -88,6 +90,7 @@ public abstract class AbstractCipherTest {
 
     @Test
     public void reInitTest() throws Exception {
+        // This test deliberately does not use try with resources in order to control the sequence of operations exactly
         CryptoCipher enc = getCipher(transformations[0]);
         enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
         enc.init(Cipher.DECRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
@@ -97,6 +100,7 @@ public abstract class AbstractCipherTest {
 
     @Test
     public void reInitAfterClose() throws Exception {
+        // This test deliberately does not use try with resources in order to control the sequence of operations exactly
         CryptoCipher enc = getCipher(transformations[0]);
         enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
         enc.close();
@@ -106,6 +110,7 @@ public abstract class AbstractCipherTest {
 
     @Test
     public void closeTestRepeat() throws Exception {
+        // This test deliberately does not use try with resources in order to control the sequence of operations exactly
         CryptoCipher enc = getCipher(transformations[0]);
         enc.close();
         enc.close(); // repeat the close