Does not make sense to test Feb 29 as a short future date
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/net/trunk@1725997 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
index 9df5fa8..72d1465 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
@@ -386,11 +386,14 @@
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)");
}
}