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 2010/09/22 15:19:32 UTC

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

Author: sebb
Date: Wed Sep 22 13:19:32 2010
New Revision: 999931

URL: http://svn.apache.org/viewvc?rev=999931&view=rev
Log:
Ensure dates are correctly parsed

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

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java?rev=999931&r1=999930&r2=999931&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java Wed Sep 22 13:19:32 2010
@@ -144,10 +144,16 @@ public class NTFTPEntryParserTest extend
             assertNotNull("Could not parse entry", file);
             assertEquals("10 years and under", file.getName());
             assertEquals(5000000000L, file.getSize());
+            Calendar timestamp = file.getTimestamp();
+            assertNotNull("Could not parse time",timestamp);
+            assertEquals("Thu May 22 00:08:00 1997",df.format(timestamp.getTime()));
             
-            FTPFile dir = getParser().parseFTPEntry("12-03-96  06:38AM       <DIR>           10 years and under");
+            FTPFile dir = getParser().parseFTPEntry("12-03-96  06:38PM       <DIR>           10 years and under");
             assertNotNull("Could not parse entry", dir);
             assertEquals("10 years and under", dir.getName());
+            timestamp = dir.getTimestamp();
+            assertNotNull("Could not parse time",timestamp);
+            assertEquals("Tue Dec 03 18:38:00 1996",df.format(timestamp.getTime()));
     }
 
     /**