commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1510623 - /commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/DataSourceUrlResolverTest.java
Date Mon, 05 Aug 2013 17:43:54 GMT
Author: britter
Date: Mon Aug  5 17:43:54 2013
New Revision: 1510623

URL: http://svn.apache.org/r1510623
Log:
Use annotation based testing for failure cases

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

Modified: commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/DataSourceUrlResolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/DataSourceUrlResolverTest.java?rev=1510623&r1=1510622&r2=1510623&view=diff
==============================================================================
--- commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/DataSourceUrlResolverTest.java
(original)
+++ commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/DataSourceUrlResolverTest.java
Mon Aug  5 17:43:54 2013
@@ -71,22 +71,13 @@ public class DataSourceUrlResolverTest e
      *
      * @throws Exception the test failed
      */
-    @Test
+    @Test(expected = IOException.class)
     public void testResolvingHttpNonLenient() throws Exception
     {
         DataSourceResolver dataSourceResolver = new DataSourceUrlResolver(new URL("http://www.apache.org"),
false);
         assertNotNull(dataSourceResolver.resolve("images/asf_logo_wide.gif"));
 
-        try
-        {
-            dataSourceResolver.resolve("images/does-not-exist.gif");
-            fail("Expecting an IOException");
-        }
-        catch(IOException e)
-        {
-            // expected
-            return;
-        }
+        dataSourceResolver.resolve("images/does-not-exist.gif");
     }
 
 }



Mime
View raw message