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
This commit is contained in:
parent
3e4d534e16
commit
b7c322c198
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user