This commit is contained in:
dotasek 2025-02-05 13:57:36 -05:00
parent 61d5a25ef9
commit 8b9c7e1df3

View File

@ -60,21 +60,25 @@ public class DateTimeUtilTests {
);
}
private static final Locale defaultLocale = Locale.getDefault();
private static Locale defaultLocale;
@BeforeAll
public static void beforeAll() {
ourLog.info("default locale: " + defaultLocale);
ourLog.info("DateTime format: " + FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
defaultLocale = Locale.getDefault();
ourLog.info("Test setup: getting current default locale");
ourLog.info("Locale.getDefault(): " + defaultLocale);
ourLog.info("Test setup: setting default locale to UK for tests");
Locale.setDefault(Locale.UK);
ourLog.info("default locale: " + defaultLocale);
ourLog.info("Locale.getDefault(): " + Locale.getDefault());
ourLog.info("DateTime format: " + FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
}
@AfterAll
public static void afterAll() {
ourLog.info("Test teardown: setting default locale back to default");
Locale.setDefault(defaultLocale);
ourLog.info("Locale.getDefault(): " + Locale.getDefault());
ourLog.info("DateTime format: " + FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
}
@ParameterizedTest