commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1812845 - in /commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest: DigestUtilsTest.java HmacAlgorithmsTest.java HmacUtilsTest.java MessageDigestAlgorithmsTest.java
Date Sat, 21 Oct 2017 18:30:35 GMT
Author: ggregory
Date: Sat Oct 21 18:30:34 2017
New Revision: 1812845

URL: http://svn.apache.org/viewvc?rev=1812845&view=rev
Log:
Remove exceptions not thrown from method signatures in tests.

Modified:
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java?rev=1812845&r1=1812844&r2=1812845&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java
Sat Oct 21 18:30:34 2017
@@ -256,7 +256,7 @@ public class DigestUtilsTest {
     }
 
     @Test
-    public void testSha224() throws IOException {
+    public void testSha224() {
         assumeJava8();
         assertEquals("d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f",
                 new DigestUtils(MessageDigestAlgorithms.SHA_224).digestAsHex(("")));
@@ -298,7 +298,7 @@ public class DigestUtilsTest {
     }
 
     @Test
-    public void testSha512() throws IOException {
+    public void testSha512() {
     // Examples from FIPS 180-2
     assertEquals("ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a" +
             "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f",

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java?rev=1812845&r1=1812844&r2=1812845&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacAlgorithmsTest.java
Sat Oct 21 18:30:34 2017
@@ -135,7 +135,7 @@ public class HmacAlgorithmsTest {
     }
 
     @Test
-    public void testAlgorithm() throws IOException, NoSuchAlgorithmException {
+    public void testAlgorithm() throws NoSuchAlgorithmException {
         final String algorithm = hmacAlgorithm.getName();
         Assert.assertNotNull(algorithm);
         Assert.assertFalse(algorithm.isEmpty());
@@ -154,7 +154,7 @@ public class HmacAlgorithmsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testHmacFailByteArray() throws IOException {
+    public void testHmacFailByteArray() {
         new HmacUtils(hmacAlgorithm, (byte[]) null).hmac(STANDARD_PHRASE_BYTES);
     }
 
@@ -164,12 +164,12 @@ public class HmacAlgorithmsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testHmacFailString() throws IOException {
+    public void testHmacFailString() {
         new HmacUtils(hmacAlgorithm, (String) null).hmac(STANDARD_PHRASE_STRING);
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testHmacHexFailByteArray() throws IOException {
+    public void testHmacHexFailByteArray() {
         new HmacUtils(hmacAlgorithm, (byte[]) null).hmac(STANDARD_PHRASE_BYTES);
     }
 
@@ -179,12 +179,12 @@ public class HmacAlgorithmsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testHmacHexFailString() throws IOException {
+    public void testHmacHexFailString() {
         new HmacUtils(hmacAlgorithm, (String) null).hmac(STANDARD_PHRASE_STRING);
     }
 
     @Test
-    public void testInitializedMac() throws IOException {
+    public void testInitializedMac() {
         final Mac mac = HmacUtils.getInitializedMac(hmacAlgorithm, STANDARD_KEY_BYTES);
         final Mac mac2 = HmacUtils.getInitializedMac(hmacAlgorithm.getName(), STANDARD_KEY_BYTES);
         Assert.assertArrayEquals(standardResultBytes, HmacUtils.updateHmac(mac, STANDARD_PHRASE_STRING).doFinal());
@@ -192,12 +192,12 @@ public class HmacAlgorithmsTest {
     }
 
     @Test
-    public void testMacByteArary() throws IOException {
+    public void testMacByteArary() {
         Assert.assertArrayEquals(standardResultBytes, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmac(STANDARD_PHRASE_BYTES));
     }
 
     @Test
-    public void testMacHexByteArray() throws IOException {
+    public void testMacHexByteArray() {
         Assert.assertEquals(standardResultString, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmacHex(STANDARD_PHRASE_BYTES));
     }
 
@@ -208,7 +208,7 @@ public class HmacAlgorithmsTest {
     }
 
     @Test
-    public void testMacHexString() throws IOException {
+    public void testMacHexString() {
         Assert.assertEquals(standardResultString, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmacHex(STANDARD_PHRASE_STRING));
     }
 
@@ -219,7 +219,7 @@ public class HmacAlgorithmsTest {
     }
 
     @Test
-    public void testMacString() throws IOException {
+    public void testMacString() {
         Assert.assertArrayEquals(standardResultBytes, new HmacUtils(hmacAlgorithm, STANDARD_KEY_BYTES).hmac(STANDARD_PHRASE_STRING));
     }
 

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java?rev=1812845&r1=1812844&r2=1812845&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
Sat Oct 21 18:30:34 2017
@@ -43,7 +43,7 @@ public class HmacUtilsTest {
     }
 
     @Test
-    public void testGetHMac() throws IOException {
+    public void testGetHMac() {
         Assert.assertArrayEquals(HmacAlgorithmsTest.STANDARD_MD5_RESULT_BYTES,
                 HmacUtils.getHmacMd5(HmacAlgorithmsTest.STANDARD_KEY_BYTES).doFinal(HmacAlgorithmsTest.STANDARD_PHRASE_BYTES));
         Assert.assertArrayEquals(HmacAlgorithmsTest.STANDARD_SHA1_RESULT_BYTES,
@@ -80,7 +80,7 @@ public class HmacUtilsTest {
     }
 
     @Test
-    public void testHmacSha1UpdateWithByteArray() throws IOException {
+    public void testHmacSha1UpdateWithByteArray() {
         final Mac mac = HmacUtils.getHmacSha1(HmacAlgorithmsTest.STANDARD_KEY_BYTES);
         HmacUtils.updateHmac(mac, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
         assertEquals(HmacAlgorithmsTest.STANDARD_SHA1_RESULT_STRING, Hex.encodeHexString(mac.doFinal()));
@@ -98,7 +98,7 @@ public class HmacUtilsTest {
     }
 
     @Test
-    public void testHmacSha1UpdateWithString() throws IOException {
+    public void testHmacSha1UpdateWithString() {
         final Mac mac = HmacUtils.getHmacSha1(HmacAlgorithmsTest.STANDARD_KEY_BYTES);
         HmacUtils.updateHmac(mac, HmacAlgorithmsTest.STANDARD_PHRASE_STRING);
         assertEquals(HmacAlgorithmsTest.STANDARD_SHA1_RESULT_STRING, Hex.encodeHexString(mac.doFinal()));
@@ -107,7 +107,7 @@ public class HmacUtilsTest {
     }
 
     @Test
-    public void testInitializedMac() throws IOException {
+    public void testInitializedMac() {
         final Mac md5Mac = HmacUtils.getInitializedMac(HmacAlgorithms.HMAC_MD5, HmacAlgorithmsTest.STANDARD_KEY_BYTES);
         final Mac md5Mac2 = HmacUtils.getInitializedMac("HmacMD5", HmacAlgorithmsTest.STANDARD_KEY_BYTES);
         Assert.assertArrayEquals(HmacAlgorithmsTest.STANDARD_MD5_RESULT_BYTES, HmacUtils.updateHmac(md5Mac,
HmacAlgorithmsTest.STANDARD_PHRASE_STRING)
@@ -117,12 +117,12 @@ public class HmacUtilsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testInitializedMacNullAlgo() throws IOException {
+    public void testInitializedMacNullAlgo() {
         HmacUtils.getInitializedMac((String) null, HmacAlgorithmsTest.STANDARD_KEY_BYTES);
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testInitializedMacNullKey() throws IOException {
+    public void testInitializedMacNullKey() {
         HmacUtils.getInitializedMac(HmacAlgorithms.HMAC_MD5, null);
     }
 
@@ -147,7 +147,7 @@ public class HmacUtilsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testMd5HMacFail() throws IOException {
+    public void testMd5HMacFail() {
         HmacUtils.hmacMd5((byte[]) null, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
     }
 
@@ -178,7 +178,7 @@ public class HmacUtilsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testSha1HMacFail() throws IOException {
+    public void testSha1HMacFail() {
         HmacUtils.hmacSha1((byte[]) null, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
     }
 
@@ -199,7 +199,7 @@ public class HmacUtilsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testSha256HMacFail() throws IOException {
+    public void testSha256HMacFail() {
         HmacUtils.hmacSha256((byte[]) null, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
     }
 
@@ -220,7 +220,7 @@ public class HmacUtilsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testSha384HMacFail() throws IOException {
+    public void testSha384HMacFail() {
         HmacUtils.hmacSha384((byte[]) null, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
     }
 
@@ -241,7 +241,7 @@ public class HmacUtilsTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testSha512HMacFail() throws IOException {
+    public void testSha512HMacFail() {
         HmacUtils.hmacSha512((byte[]) null, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
     }
 }
\ No newline at end of file

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java?rev=1812845&r1=1812844&r2=1812845&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
Sat Oct 21 18:30:34 2017
@@ -89,7 +89,7 @@ public class MessageDigestAlgorithmsTest
         this.messageDigestAlgorithm = messageDigestAlgorithm;
     }
 
-    private byte[] digestTestData() throws IOException {
+    private byte[] digestTestData() {
         return DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm),getTestData());
     }
 
@@ -114,7 +114,7 @@ public class MessageDigestAlgorithmsTest
     }
 
     @Test
-    public void testAlgorithm() throws IOException, NoSuchAlgorithmException {
+    public void testAlgorithm() throws NoSuchAlgorithmException {
         final String algorithm = messageDigestAlgorithm;
         Assert.assertNotNull(algorithm);
         Assert.assertFalse(algorithm.isEmpty());
@@ -123,7 +123,7 @@ public class MessageDigestAlgorithmsTest
     }
 
     @Test
-    public void testDigestByteArray() throws IOException {
+    public void testDigestByteArray() {
         Assume.assumeTrue(DigestUtils.isAvailable(messageDigestAlgorithm));
         Assert.assertArrayEquals(digestTestData(),
                 DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm), getTestData()));
@@ -131,7 +131,7 @@ public class MessageDigestAlgorithmsTest
     }
 
     @Test
-    public void testDigestByteBuffer() throws IOException {
+    public void testDigestByteBuffer() {
         Assume.assumeTrue(DigestUtils.isAvailable(messageDigestAlgorithm));
         Assert.assertArrayEquals(digestTestData(),
                 DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm), ByteBuffer.wrap(getTestData())));
@@ -155,7 +155,7 @@ public class MessageDigestAlgorithmsTest
     }
 
     @Test
-    public void testGetMessageDigest() throws IOException, NoSuchAlgorithmException {
+    public void testGetMessageDigest() {
         Assume.assumeTrue(DigestUtils.isAvailable(messageDigestAlgorithm));
         final MessageDigest messageDigest = DigestUtils.getDigest(messageDigestAlgorithm);
         Assert.assertEquals(messageDigestAlgorithm, messageDigest.getAlgorithm());



Mime
View raw message