FileDocCategorySizeDatePackage
OS2FTPEntryParserTest.javaAPI DocApache Commons NET 1.4.1 API4590Sat Dec 03 10:05:48 GMT 2005org.apache.commons.net.ftp.parser

OS2FTPEntryParserTest

public class OS2FTPEntryParserTest extends FTPParseTestFramework
author
Steve Cohen
version
$Id: OS2FTPEntryParserTest.java 155429 2005-02-26 13:13:04Z dirkv $

Fields Summary
private static final String[]
badsamples
private static final String[]
goodsamples
Constructors Summary
public OS2FTPEntryParserTest(String name)

see
junit.framework.TestCase#TestCase(String)


           
      
    
        super(name);
    
Methods Summary
protected java.lang.String[]getBadListing()

see
org.apache.commons.net.ftp.parser.FTPParseTestFramework#getBadListing()


        return (badsamples);
    
protected java.lang.String[]getGoodListing()

see
org.apache.commons.net.ftp.parser.FTPParseTestFramework#getGoodListing()


        return (goodsamples);
    
protected org.apache.commons.net.ftp.FTPFileEntryParsergetParser()

see
org.apache.commons.net.ftp.parser.FTPParseTestFramework#getParser()

        ConfigurableFTPFileEntryParserImpl parser =
            new OS2FTPEntryParser();
        parser.configure(null);
        return parser;
    
public static junit.framework.TestSuitesuite()
Method suite.

return
TestSuite


        return (new TestSuite(OS2FTPEntryParserTest.class));
    
public voidtestParseFieldsOnDirectory()

see
org.apache.commons.net.ftp.parser.FTPParseTestFramework#testParseFieldsOnDirectory()

        FTPFile dir = getParser().parseFTPEntry("     0           DIR   11-28-97   09:42  PC");
        assertNotNull("Could not parse entry.", dir);
        assertTrue("Should have been a directory.",
                   dir.isDirectory());
        assertEquals(0,dir.getSize());
        assertEquals("PC", dir.getName());
        assertEquals("Fri Nov 28 09:42:00 1997",
                     df.format(dir.getTimestamp().getTime()));
    
public voidtestParseFieldsOnFile()

see
org.apache.commons.net.ftp.parser.FTPParseTestFramework#testParseFieldsOnFile()

        FTPFile file = getParser().parseFTPEntry("5000000000      A          11-17-98   16:07  POPUPLOG.OS2");
        assertNotNull("Could not parse entry.", file);
        assertTrue("Should have been a file.",
                   file.isFile());
        assertEquals(5000000000L, file.getSize());
        assertEquals("POPUPLOG.OS2", file.getName());
        assertEquals("Tue Nov 17 16:07:00 1998",
                     df.format(file.getTimestamp().getTime()));