# HG changeset patch # User kcr # Date 1467156749 25200 # Tue Jun 28 16:32:29 2016 -0700 # Node ID caca60a82db836afcbd96c1ba519d36e91bcc623 # Parent 9b0b1900dd16dc7a1538298107d920d1abcfb621 8160039: LocalDateTimeStringConverterTest fails when default locale is different to en_US Reviewed-by: diff --git a/modules/base/src/test/java/test/javafx/util/converter/LocalDateTimeStringConverterTest.java b/modules/base/src/test/java/test/javafx/util/converter/LocalDateTimeStringConverterTest.java --- a/modules/base/src/test/java/test/javafx/util/converter/LocalDateTimeStringConverterTest.java +++ b/modules/base/src/test/java/test/javafx/util/converter/LocalDateTimeStringConverterTest.java @@ -40,7 +40,7 @@ import javafx.util.converter.LocalDateTimeStringConverter; import javafx.util.converter.LocalDateTimeStringConverterShim; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.Ignore; import org.junit.runner.RunWith; @@ -56,6 +56,12 @@ private static final DateTimeFormatter aFormatter = DateTimeFormatter.ofPattern("dd MM yyyy HH mm ss"); private static final DateTimeFormatter aParser = DateTimeFormatter.ofPattern("yyyy MM dd hh mm ss a"); + @BeforeClass + public static void initDefaultLocale() { + // Tests require that default locale is en_US + Locale.setDefault(Locale.US); + } + @Parameterized.Parameters public static Collection implementations() { return Arrays.asList(new Object[][] { { new LocalDateTimeStringConverter(), @@ -90,9 +96,6 @@ this.parser = parser; } - @Before public void setup() { - } - /********************************************************************* * Test constructors ********************************************************************/