8147912: test "parseWithZoneWithoutOffset" of java/time/tck/java/time/format/TCKDTFParsedInstant.java fail on de_DE locale
authorrpatil
Tue, 02 Feb 2016 13:55:44 +0530
changeset 35638 77952fd46ccd
parent 35637 0692b40eb3f9
child 35639 f34e7e8b4eac
8147912: test "parseWithZoneWithoutOffset" of java/time/tck/java/time/format/TCKDTFParsedInstant.java fail on de_DE locale Summary: Even though hardcoded data is not preferred in compatibility test cases, this case was exception. English is provided as the default locale data for DateTimeFormatter in this testcase. Reviewed-by: okutsu, scolebourne
jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java
--- a/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java	Tue Feb 02 10:44:55 2016 +0100
+++ b/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java	Tue Feb 02 13:55:44 2016 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Locale;
 
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
@@ -194,7 +195,7 @@
 
     @Test(dataProvider="parseWithZoneWithoutOffset")
     public void testWithZoneWithoutOffset(String withZoneWithoutOffset, ZonedDateTime expectedZDT) {
-        dtFormatter = DateTimeFormatter.ofPattern("d MMM HH:mm:ss uuuu VV");
+        dtFormatter = DateTimeFormatter.ofPattern("d MMM HH:mm:ss uuuu VV").withLocale(Locale.ENGLISH);
         zdt1 = ZonedDateTime.parse(withZoneWithoutOffset, dtFormatter);
         assertEquals(expectedZDT, zdt1);
     }