commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1074629 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
Date Fri, 25 Feb 2011 16:55:53 GMT
Author: sebb
Date: Fri Feb 25 16:55:53 2011
New Revision: 1074629

URL: http://svn.apache.org/viewvc?rev=1074629&view=rev
Log:
Add more parser tests

Modified:
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java?rev=1074629&r1=1074628&r2=1074629&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
Fri Feb 25 16:55:53 2011
@@ -91,6 +91,23 @@ public class DefaultFTPFileEntryParserFa
             Throwable root = pie.getRootCause();
             assertTrue(root instanceof ClassCastException);
         }
+
+        try {
+            // Class exists, but is an interface
+            factory.createFileEntryParser("org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory");
+            fail("ParserInitializationException should have been thrown.");
+        } catch (ParserInitializationException pie){
+            Throwable root = pie.getRootCause();
+            assertTrue(root instanceof InstantiationException);            
+        }
+        try {
+            // Class exists, but is abstract
+            factory.createFileEntryParser("org.apache.commons.net.ftp.FTPFileEntryParserImpl");
+            fail("ParserInitializationException should have been thrown.");
+        } catch (ParserInitializationException pie){
+            Throwable root = pie.getRootCause();
+            assertTrue(root instanceof InstantiationException);            
+        }
     }
 }
 



Mime
View raw message