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 2016/01/21 16:53:36 UTC

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

Author: sebb
Date: Thu Jan 21 15:53:36 2016
New Revision: 1725997

URL: http://svn.apache.org/viewvc?rev=1725997&view=rev
Log:
Does not make sense to test Feb 29 as a short future date

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

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java?rev=1725997&r1=1725996&r2=1725997&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java Thu Jan 21 15:53:36 2016
@@ -386,11 +386,14 @@ public class FTPTimestampParserImplTest
     public void testFeb29IfLeapYear() throws Exception{
         GregorianCalendar now = new GregorianCalendar();
         final int thisYear = now.get(Calendar.YEAR);
-        if (now.isLeapYear(thisYear) && now.before(new GregorianCalendar(thisYear,Calendar.AUGUST,29))){
-            GregorianCalendar target = new GregorianCalendar(thisYear,Calendar.FEBRUARY,29);
+        final GregorianCalendar target = new GregorianCalendar(thisYear,Calendar.FEBRUARY,29);
+        if (now.isLeapYear(thisYear)
+         && now.after(target)
+         && now.before(new GregorianCalendar(thisYear,Calendar.AUGUST,29))
+        ){
             checkShortParse("Feb 29th",now,target);
         } else {
-            System.out.println("Skipping Feb 29 test");
+            System.out.println("Skipping Feb 29 test (not leap year or before Feb 29)");
         }
     }