From b7c322c19841504a79ee782e1844734900ecdd4e Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 30 Jul 2013 14:43:19 -0700 Subject: [PATCH] 8021767: test/java/time/tck/java/time/format/TCKFormatStyle.java failing Correct to use fixed locale, not locale of test environment Reviewed-by: alanb, okutsu --- jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java b/jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java index 280dd0999de..11756733ca2 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java +++ b/jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java @@ -64,6 +64,7 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.format.FormatStyle; import java.time.temporal.Temporal; +import java.util.Locale; import static org.testng.Assert.assertEquals; @@ -108,6 +109,7 @@ public class TCKFormatStyle { public void test_formatStyle(Temporal temporal, FormatStyle style, String formattedStr) { DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder(); DateTimeFormatter formatter = builder.appendLocalized(style, style).appendLiteral(" ").appendZoneOrOffsetId().toFormatter(); + formatter = formatter.withLocale(Locale.US); assertEquals(formatter.format(temporal), formattedStr); } }