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("[email protected]", "[email protected]",
"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("[email protected]", "[email protected]",
"bad.encoding\uc5ec\n");
}
/**