8021767: test/java/time/tck/java/time/format/TCKFormatStyle.java failing
Summary: Correct to use fixed locale, not locale of test environment
Reviewed-by: alanb, okutsu
Contributed-by: roger.riggs@oracle.com
--- a/jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java Tue Jul 30 11:04:19 2013 -0700
+++ b/jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java Tue Jul 30 14:43:19 2013 -0700
@@ -64,6 +64,7 @@
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 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);
}
}