You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/02/25 17:55:53 UTC

svn commit: r1074629 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java

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);            
+        }
     }
 }