commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1380024 - /commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java
Date Sun, 02 Sep 2012 18:34:31 GMT
Author: ggregory
Date: Sun Sep  2 18:34:30 2012
New Revision: 1380024

URL: http://svn.apache.org/viewvc?rev=1380024&view=rev
Log:
[CODEC-155] DigestUtils.getDigest(String) should throw IllegalArgumentException instead of
RuntimeException. Use JUnit 4 expected annotation to test instead of try/catch block.

Modified:
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.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=1380024&r1=1380023&r2=1380024&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
Sun Sep  2 18:34:30 2012
@@ -55,14 +55,9 @@ public class DigestUtilsTest {
         assertNotNull(new DigestUtils());
     }
 
-    @Test
+    @Test(expected=IllegalArgumentException.class)
     public void testInternalNoSuchAlgorithmException() {
-        try {
-            DigestUtils.getDigest("Bogus Bogus");
-            fail("A RuntimeException should have been thrown.");
-        } catch (RuntimeException e) {
-            // Expected exception.
-        }
+        DigestUtils.getDigest("Bogus Bogus");
     }
 
     @Test



Mime
View raw message