Skip to content

Commit

Permalink
Split out failing test on GitHub for Local "pt_PT" (Portugal)
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Aug 10, 2023
1 parent 7733c39 commit 61ed780
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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;
Expand All @@ -33,7 +34,7 @@
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");
Expand All @@ -43,8 +44,11 @@ void testLang1219() throws ParseException {

@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) {
Expand All @@ -64,4 +68,12 @@ void testTimeZoneStrategyPattern(final Locale locale) {
}
}
}

/**
* Breaks randomly on GitHub.
*/
@Test
public void testTimeZoneStrategyPatternPortugal() {
testTimeZoneStrategyPattern(Locale.forLanguageTag("pt_PT"), TimeZone.getDefault());
}
}

0 comments on commit 61ed780

Please sign in to comment.