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 fe0d58f97..4faa822b4 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 @@ -99,17 +99,6 @@ private void checkShortParse(final String msg, final Calendar servertime, final } } - // This test currently fails, because we assume that short dates are +-6months when parsing Feb 29 - @Test - @Disabled - public void testNET446() throws Exception { - final GregorianCalendar server = new GregorianCalendar(2001, Calendar.JANUARY, 1, 12, 0); - // Note: we use a known leap year for the target date to avoid rounding up - final GregorianCalendar input = new GregorianCalendar(2000, Calendar.FEBRUARY, 29); - final GregorianCalendar expected = new GregorianCalendar(2000, Calendar.FEBRUARY, 29); - checkShortParse("Feb 29th 2000", server, input, expected); - } - // Test leap year if current year is a leap year @Test public void testFeb29IfLeapYear() throws Exception { @@ -166,8 +155,6 @@ public void testFeb29NonLeapYear() { assertThrows(ParseException.class, () -> checkShortParse("Feb 29th 1999", server, input, expected, false)); } -// Lenient mode allows for dates up to 1 day in the future - @Test public void testNET444() throws Exception { final FTPTimestampParserImpl parser = new FTPTimestampParserImpl(); @@ -188,6 +175,27 @@ public void testNET444() throws Exception { assertEquals(nowplus25.get(Calendar.YEAR) - 1, parsed25.get(Calendar.YEAR)); } +// Lenient mode allows for dates up to 1 day in the future + + // This test currently fails, because we assume that short dates are +-6months when parsing Feb 29 + @Test + @Disabled + public void testNET446() throws Exception { + final GregorianCalendar server = new GregorianCalendar(2001, Calendar.JANUARY, 1, 12, 0); + // Note: we use a known leap year for the target date to avoid rounding up + final GregorianCalendar input = new GregorianCalendar(2000, Calendar.FEBRUARY, 29); + final GregorianCalendar expected = new GregorianCalendar(2000, Calendar.FEBRUARY, 29); + checkShortParse("Feb 29th 2000", server, input, expected); + } + + @Test + @Disabled + public void testNet710() throws ParseException { + Calendar serverTime = Calendar.getInstance(TimeZone.getTimeZone("EDT"), Locale.US); + serverTime.set(2022, 2, 16, 14, 0); + new FTPTimestampParserImpl().parseTimestamp("Mar 13 02:33", serverTime); + } + @Test public void testParseDec31Lenient() throws Exception { final GregorianCalendar now = new GregorianCalendar(2007, Calendar.DECEMBER, 30, 12, 0);