changeset 20746:e41a8a513b3e

8024612: java/time/tck/java/time/format/TCKDateTimeFormatters.java failed Summary: The test should be using the Locale.Category.FORMAT to verify the test data Reviewed-by: lancea
author rriggs
date Wed, 09 Oct 2013 11:02:55 -0400
parents 3d2e35965c56
children 86a86a94b367
files jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java	Wed Oct 09 06:24:42 2013 -0700
+++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java	Wed Oct 09 11:02:55 2013 -0400
@@ -126,9 +126,10 @@
     @Test
     public void test_pattern_String() {
         DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy");
+        Locale fmtLocale = Locale.getDefault(Locale.Category.FORMAT);
         assertEquals(test.format(LocalDate.of(2012, 6, 30)), "30 " +
-                Month.JUNE.getDisplayName(TextStyle.SHORT, Locale.getDefault()) + " 2012");
-        assertEquals(test.getLocale(), Locale.getDefault());
+                Month.JUNE.getDisplayName(TextStyle.SHORT, fmtLocale) + " 2012");
+        assertEquals(test.getLocale(), fmtLocale, "Locale.Category.FORMAT");
     }
 
     @Test(expectedExceptions=IllegalArgumentException.class)