You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2013/07/26 23:31:16 UTC

svn commit: r1507466 - /commons/proper/email/trunk/src/test/java/org/apache/commons/mail/EmailTest.java

Author: britter
Date: Fri Jul 26 21:31:16 2013
New Revision: 1507466

URL: http://svn.apache.org/r1507466
Log:
Another case of splitting up failure test and use annotation based style

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

Modified: commons/proper/email/trunk/src/test/java/org/apache/commons/mail/EmailTest.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/EmailTest.java?rev=1507466&r1=1507465&r2=1507466&view=diff
==============================================================================
--- commons/proper/email/trunk/src/test/java/org/apache/commons/mail/EmailTest.java (original)
+++ commons/proper/email/trunk/src/test/java/org/apache/commons/mail/EmailTest.java Fri Jul 26 21:31:16 2013
@@ -346,24 +346,11 @@ public class EmailTest extends AbstractE
             assertEquals(arrExpected.get(i), this.email.getFromAddress());
 
         }
+    }
 
-        // ====================================================================
-        // Test Exceptions
-        // ====================================================================
-        // reset the mail class
-        MockEmailConcrete anotherEmail = new MockEmailConcrete();
-
-        // bad encoding
-        try
-        {
-            // set a dodgy encoding scheme
-            anotherEmail.setFrom("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
-            fail("setting invalid charset should have failed!");
-        }
-        catch (IllegalCharsetNameException e)
-        {
-            // expected runtime exception.
-        }
+    @Test(expected = IllegalCharsetNameException.class)
+    public void testSetFromBadEncoding() throws Exception {
+        this.email.setFrom("me@home.com", "me@home.com", "bad.encoding\uc5ec\n");
     }
 
     /**