changeset 13464:d4cd3a5a3d12

8043387: java/time/test/java/util/TestFormatter.java failed. Summary: Do not remove custom IDs from ZoneId test results. Reviewed-by: sherman
author naoto
date Wed, 06 Mar 2019 19:45:24 +0000
parents e82f912e5ae1
children dea84489c35e
files test/java/time/test/java/util/TestFormatter.java
diffstat 1 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/time/test/java/util/TestFormatter.java	Mon Mar 04 19:15:04 2019 +0530
+++ b/test/java/time/test/java/util/TestFormatter.java	Wed Mar 06 19:45:24 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, 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
@@ -46,7 +46,7 @@
 
 /* @test
  * @summary Unit test for j.u.Formatter threeten date/time support
- * @bug 8003680 8012638
+ * @bug 8003680 8043387 8012638
  */
 @Test
 public class TestFormatter {
@@ -196,10 +196,6 @@
         }
     }
 
-    private String toZoneIdStr(String expected) {
-        return expected.replaceAll("(?:GMT|UTC)(?<off>[+\\-]?[0-9]{2}:[0-9]{2})", "${off}");
-    }
-
     private String toZoneOffsetStr(String expected) {
         return expected.replaceAll("(?:GMT|UTC)(?<off>[+\\-]?[0-9]{2}:[0-9]{2})", "${off}")
                        .replaceAll("GMT|UTC|UT", "Z");
@@ -208,7 +204,7 @@
     private void testZoneId(Locale locale, ChronoZonedDateTime<?> zdt, Calendar cal) {
         String fmtStr = "z:[%tz] z:[%1$Tz] Z:[%1$tZ] Z:[%1$TZ]";
         printFmtStr(locale, fmtStr);
-        String expected = toZoneIdStr(test(fmtStr, locale, null, cal));
+        String expected = test(fmtStr, locale, null, cal);
         test(fmtStr, locale, expected, zdt);
         // get a new cal with fixed tz
         Calendar cal0 = Calendar.getInstance();
@@ -224,7 +220,7 @@
         // datetime + zid
         fmtStr = "c:[%tc] c:[%1$Tc]";
         printFmtStr(locale, fmtStr);
-        expected = toZoneIdStr(test(fmtStr, locale, null, cal));
+        expected = test(fmtStr, locale, null, cal);
         test(fmtStr, locale, expected, zdt);
     }