harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r588653 - /harmony/enhanced/classlib/trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
Date Fri, 26 Oct 2007 14:06:44 GMT
Author: odeakin
Date: Fri Oct 26 07:06:43 2007
New Revision: 588653

URL: http://svn.apache.org/viewvc?rev=588653&view=rev
Log:
Let JUnit deal with unexpected Exceptions rather than catching them ourselves.

Modified:
    harmony/enhanced/classlib/trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java?rev=588653&r1=588652&r2=588653&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
Fri Oct 26 07:06:43 2007
@@ -381,12 +381,12 @@
             try {
                 skF[i].getKeySpec(secKey, null);
                 fail("getKeySpec(secKey, null): NullPointerException or InvalidKeySpecException
must be thrown");
-            } catch (Exception e) {
-                if (!(e instanceof NullPointerException) &&
-                        !(e instanceof InvalidKeySpecException)) {
-                    fail("Unexpected: "+e.toString() + "was thrown");
-                }
+            } catch (InvalidKeySpecException e) {
+                // Expected
+            } catch (NullPointerException e) {
+                // Expected
             }
+                
             try {
                 Class c;
                 if (defaultAlgorithm.equals(defaultAlgorithm2)) {



Mime
View raw message