8021767: test/java/time/tck/java/time/format/TCKFormatStyle.java failing
authorsherman
Tue, 30 Jul 2013 14:43:19 -0700
changeset 19070 24b4333be1d8
parent 19069 1d9cb0d080e3
child 19071 bc096b85d91d
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
jdk/test/java/time/tck/java/time/format/TCKFormatStyle.java
--- 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);
     }
 }