commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1644697 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/
Date Thu, 11 Dec 2014 17:00:57 GMT
Author: sebb
Date: Thu Dec 11 17:00:57 2014
New Revision: 1644697

URL: http://svn.apache.org/r1644697
Log:
Test precision unit tests

Modified:
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -115,11 +115,11 @@ public class EnterpriseUnixFTPEntryParse
         checkPermisions(file);
     }
 
-    public void testPrecisionMinutes() {
+    public void testRecentPrecision() {
         testPrecision("-C--E-----FTP B QUA1I1      18128       5000000000 Aug 12 13:56 QUADTEST",
CalendarUnit.MINUTE);
     }
 
-    public void testPrecisionDays() {
+    public void testDefaultPrecision() {
         testPrecision("-C--E-----FTP B QUA1I1      18128       5000000000 Aug 12 2014 QUADTEST",
CalendarUnit.DAY_OF_MONTH);
     }
 

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
Thu Dec 11 17:00:57 2014
@@ -186,5 +186,9 @@ public abstract class FTPParseTestFramew
             assertFalse("Expected not set "+prevUnit+" in "+listEntry, stamp.isSet(prevUnit.unit));
           
         }
     }
-    
+
+    // Force subclasses to test precision
+    abstract public void testDefaultPrecision();
+
+    abstract public void testRecentPrecision();
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -95,4 +95,15 @@ public class MLSxEntryParserTest extends
 //    @Override
     public void testParseFieldsOnDirectory() throws Exception {
     }
+
+    @Override
+    public void testDefaultPrecision() {
+        testPrecision("Type=dir;Modify=20141022065102;UNIX.mode=0775; source", CalendarUnit.SECOND);
+        
+    }
+
+    @Override
+    public void testRecentPrecision() { // borrow this method to test milliseconds
+        testPrecision("Type=dir;Modify=20141022065102.999;UNIX.mode=0775; source", CalendarUnit.MILLISECOND);
+    }
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -218,4 +218,16 @@ public class MVSFTPEntryParserTest exten
         assertNull("Timestamp should not have been set.", file.getTimestamp());
 
     }
+
+    @Override
+    public void testDefaultPrecision() {
+        // TODO Not sure what dates are parsed
+        
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        // TODO Auto-generated method stub
+        
+    }
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -148,4 +148,14 @@ public class MacOsPeterFTPEntryParserTes
                 FTPFile.WORLD_ACCESS, FTPFile.EXECUTE_PERMISSION));
     }
 
+    @Override
+    public void testDefaultPrecision() {
+        testPrecision("-rw-r--r--    78440       49231   127671 Jul 22  2010 Filename with
whitespace.jpg", CalendarUnit.DAY_OF_MONTH);
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        testPrecision("-rw-r--r--    78440       49231   127671 Jul 22 14:51 Filename with
whitespace.jpg", CalendarUnit.MINUTE);
+    }
+
 }

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=1644697&r1=1644696&r2=1644697&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
Thu Dec 11 17:00:57 2014
@@ -339,4 +339,15 @@ public class NTFTPEntryParserTest extend
         int iso8859_1 = testNET516("ISO-8859-1");
         assertEquals(LISTFILE_COUNT, iso8859_1);
     }
+
+    @Override
+    public void testDefaultPrecision() {
+        testPrecision("05-26-1995  10:57AM               143712 $LDR$", CalendarUnit.MINUTE);
+        testPrecision("05-22-97  08:08                    828 AUTOEXEC.BAK", CalendarUnit.MINUTE);
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        // Not used
+    }
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -100,4 +100,16 @@ public class NetwareFTPEntryParserTest e
         assertFalse(f.hasPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION));
     }
 
+    @Override
+    public void testDefaultPrecision() {
+        testPrecision("d [RWCEAFMS] rwinston                          512 Nov 24  2005 Favorites",
CalendarUnit.DAY_OF_MONTH);
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        testPrecision("- [RWCEAFMS] rwinston                        19968 Mar 12 15:20 Executive
Summary.doc", CalendarUnit.MINUTE);
+    }
+
 }
+
+

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -105,4 +105,15 @@ public class OS2FTPEntryParserTest exten
         parser.configure(null);
         return parser;
     }
+
+    @Override
+    public void testDefaultPrecision() {
+        testPrecision("     0           DIR   05-12-97   16:44  PSFONTS", CalendarUnit.MINUTE);
+        testPrecision("     0           DIR   05-19-2000 12:56  local", CalendarUnit.MINUTE);
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        // Not needed
+    }
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
Thu Dec 11 17:00:57 2014
@@ -143,4 +143,14 @@ public class OS400FTPEntryParserAddition
         assertEquals(df.format(cal.getTime()),
                      df.format(f.getTimestamp().getTime()));
     }
+
+    @Override
+    public void testDefaultPrecision() {
+        // Done in other class
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        // Done in other class
+    }
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -172,4 +172,14 @@ public class OS400FTPEntryParserTest ext
         assertEquals(df.format(cal.getTime()),
                      df.format(f.getTimestamp().getTime()));
     }
+
+    @Override
+    public void testDefaultPrecision() {
+        testPrecision("PEP              4019 04/03/18 18:58:16 *STMF      einladung.zip",
CalendarUnit.SECOND);
+    }
+
+    @Override
+    public void testRecentPrecision() {
+        testPrecision("----rwxr-x   1 PEP      0           4019 Mar 18 18:58 einladung.zip",
CalendarUnit.MINUTE);
+    }
 }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -244,11 +244,11 @@ public class UnixFTPEntryParserTest exte
     }
 
 
-    public void testPrecisionMinutes() {
+    public void testRecentPrecision() {
         testPrecision("drwxr-xr-x   2 user     group         4096 Mar  2 15:13 zxbox", CalendarUnit.MINUTE);
     }
 
-    public void testPrecisionDays() {
+    public void testDefaultPrecision() {
         testPrecision("drwxr-xr-x   2 user     group         4096 Mar  2 2014 zxbox", CalendarUnit.DAY_OF_MONTH);
     }
 

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java?rev=1644697&r1=1644696&r2=1644697&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
(original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
Thu Dec 11 17:00:57 2014
@@ -204,9 +204,13 @@ public class VMSFTPEntryParserTest exten
         checkPermisions(file, 0400);
     }
 
-    public void testPrecisionSeconds() {
+    public void testDefaultPrecision() {
         testPrecision("1-JUN.LIS;1              9/9           2-JUN-1998 07:32:04  [TRANSLATED]
   (RWED,RD,,)", CalendarUnit.SECOND);
     }
+    
+    public void testRecentPrecision() {
+        // Not used
+    }
 
     @Override
     protected String[] getBadListing()



Mime
View raw message