You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/08/10 13:56:05 UTC

[commons-lang] branch master updated: Split out failing test on GitHub for Local "pt_PT" (Portugal)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 61ed78011 Split out failing test on GitHub for Local "pt_PT" (Portugal)
61ed78011 is described below

commit 61ed7801188bb19acf5d755eb2e4b74fd9a0b1b0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Aug 10 09:55:59 2023 -0400

    Split out failing test on GitHub for Local "pt_PT" (Portugal)
---
 .../time/FastDateParser_TimeZoneStrategyTest.java      | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
index 34a96d342..c40f367fc 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
@@ -23,6 +23,7 @@ import java.text.DateFormatSymbols;
 import java.text.ParseException;
 import java.util.Date;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.TimeZone;
 
 import org.apache.commons.lang3.AbstractLangTest;
@@ -33,7 +34,7 @@ import org.junit.jupiter.params.provider.MethodSource;
 public class FastDateParser_TimeZoneStrategyTest extends AbstractLangTest {
 
     @Test
-    void testLang1219() throws ParseException {
+    public void testLang1219() throws ParseException {
         final FastDateParser parser = new FastDateParser("dd.MM.yyyy HH:mm:ss z", TimeZone.getDefault(), Locale.GERMAN);
 
         final Date summer = parser.parse("26.10.2014 02:00:00 MESZ");
@@ -43,8 +44,11 @@ public class FastDateParser_TimeZoneStrategyTest extends AbstractLangTest {
 
     @ParameterizedTest
     @MethodSource("java.util.Locale#getAvailableLocales")
-    void testTimeZoneStrategyPattern(final Locale locale) {
-        final TimeZone tzDefault = TimeZone.getDefault();
+    public void testTimeZoneStrategyPattern(final Locale locale) {
+        testTimeZoneStrategyPattern(Objects.requireNonNull(locale, "locale"), TimeZone.getDefault());
+    }
+
+    private void testTimeZoneStrategyPattern(final Locale locale, final TimeZone tzDefault) {
         final FastDateParser parser = new FastDateParser("z", tzDefault, locale);
         final String[][] zones = DateFormatSymbols.getInstance(locale).getZoneStrings();
         for (final String[] zone : zones) {
@@ -64,4 +68,12 @@ public class FastDateParser_TimeZoneStrategyTest extends AbstractLangTest {
             }
         }
     }
+
+    /**
+     * Breaks randomly on GitHub.
+     */
+    @Test
+    public void testTimeZoneStrategyPatternPortugal() {
+        testTimeZoneStrategyPattern(Locale.forLanguageTag("pt_PT"), TimeZone.getDefault());
+    }
 }