commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r513307 - /jakarta/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailTest.java
Date Thu, 01 Mar 2007 13:22:35 GMT
Author: dion
Date: Thu Mar  1 05:22:34 2007
New Revision: 513307

URL: http://svn.apache.org/viewvc?view=rev&rev=513307
Log:
Make tests catch appropriate runtime exception, as the runtime IllegalCharsetNameException
is no longer wrapped in an EmailException.

Modified:
    jakarta/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailTest.java

Modified: jakarta/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailTest.java?view=diff&rev=513307&r1=513306&r2=513307
==============================================================================
--- jakarta/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailTest.java (original)
+++ jakarta/commons/proper/email/trunk/src/test/org/apache/commons/mail/EmailTest.java Thu
Mar  1 05:22:34 2007
@@ -382,10 +382,9 @@
             anotherEmail.setFrom("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
             fail("setting invalid charset should have failed!");
         }
-        catch (EmailException e)
+        catch (IllegalCharsetNameException e)
         {
             // expected runtime exception.
-            assertTrue(e.getCause() instanceof IllegalCharsetNameException);
         }
     }
 
@@ -506,10 +505,9 @@
             anotherEmail.addTo("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
             fail("setting invalid charset should have failed!");
         }
-        catch (EmailException e)
+        catch (IllegalCharsetNameException  e)
         {
             // expected runtime exception.
-            assertTrue(e.getCause() instanceof IllegalCharsetNameException);
         }
     }
 
@@ -685,10 +683,9 @@
             anotherEmail.addCc("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
             fail("setting invalid charset should have failed!");
         }
-        catch (EmailException e)
+        catch (IllegalCharsetNameException e)
         {
             // expected runtime exception.
-            assertTrue(e.getCause() instanceof IllegalCharsetNameException);
         }
     }
 
@@ -860,10 +857,9 @@
             anotherEmail.addBcc("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
             fail("setting invalid charset should have failed!");
         }
-        catch (EmailException e)
+        catch (IllegalCharsetNameException e)
         {
             // expected runtime exception.
-            assertTrue(e.getCause() instanceof IllegalCharsetNameException);
         }
     }
 
@@ -1040,10 +1036,9 @@
             anotherEmail.addReplyTo("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
             fail("setting invalid charset should have failed!");
         }
-        catch (EmailException e)
+        catch (IllegalCharsetNameException e)
         {
             // expected runtime exception.
-            assertTrue(e.getCause() instanceof IllegalCharsetNameException);
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message