garydgregory commented on code in PR #406:
URL: https://github.com/apache/commons-net/pull/406#discussion_r3665288653
##########
src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java:
##########
@@ -68,6 +75,25 @@ protected FTPFile nullFileOrNullDate(final FTPFile f) {
return f;
}
+ /**
+ * The RFC 3659 time stamp is a numeric Gregorian date. Parsing it must
not depend on the JVM default locale's calendar, which for e.g. a Thai locale
is a
+ * Buddhist calendar that would read the year 543 years out.
+ */
+ @Test
+ void testParseGMTdateTimeWithNonGregorianDefaultLocale() {
+ final Locale defaultLocale = Locale.getDefault();
+ try {
+ Locale.setDefault(new Locale("th", "TH"));
+ final Calendar parsed =
MLSxEntryParser.parseGMTdateTime("20100313224553");
Review Comment:
Use JUnit Pioneer to set the default Locale:
https://junit-pioneer.org/docs/default-locale-timezone/
##########
src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java:
##########
@@ -68,6 +75,25 @@ protected FTPFile nullFileOrNullDate(final FTPFile f) {
return f;
}
+ /**
+ * The RFC 3659 time stamp is a numeric Gregorian date. Parsing it must
not depend on the JVM default locale's calendar, which for e.g. a Thai locale
is a
+ * Buddhist calendar that would read the year 543 years out.
+ */
+ @Test
+ void testParseGMTdateTimeWithNonGregorianDefaultLocale() {
+ final Locale defaultLocale = Locale.getDefault();
+ try {
+ Locale.setDefault(new Locale("th", "TH"));
Review Comment:
Use JUnit Pioneer to set the default Locale:
https://junit-pioneer.org/docs/default-locale-timezone/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]