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("[EMAIL PROTECTED]", "[EMAIL PROTECTED]", 
"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("[EMAIL PROTECTED]", "[EMAIL PROTECTED]", 
"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("[EMAIL PROTECTED]", "[EMAIL PROTECTED]", 
"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("[EMAIL PROTECTED]", "[EMAIL PROTECTED]", 
"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("[EMAIL PROTECTED]", "[EMAIL PROTECTED]", 
"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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to