test/java/util/Calendar/NarrowNamesTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -31,12 +31,16 @@
 
     private static final String RESET_INDEX = "RESET_INDEX";
 
     private static int errors = 0;
 
+    private static String providers;
+
     // This test is locale data-dependent.
     public static void main(String[] args) {
+        providers = args[0];
+
         test(US, ERA, "B",
              ERA, BC, YEAR, 1);
         test(US, ERA, "A",
              ERA, AD, YEAR, 2012);
         test(US, DAY_OF_WEEK, "S",

@@ -74,11 +78,19 @@
         testMap(US, DAY_OF_WEEK, NARROW_FORMAT); // expect null
         testMap(US, AM_PM, ALL_STYLES,
                 "AM", "PM",
                 RESET_INDEX,
                 "a", "p");
-        testMap(JAJPJP, DAY_OF_WEEK, NARROW_STANDALONE); // expect null
+        testMap(JAJPJP, DAY_OF_WEEK, NARROW_STANDALONE,
+                "", // 1-based indexing for DAY_OF_WEEK
+                "\u65e5",
+                "\u6708",
+                "\u706b",
+                "\u6c34",
+                "\u6728",
+                "\u91d1",
+                "\u571f");
         testMap(JAJPJP, DAY_OF_WEEK, NARROW_FORMAT,
                 "", // 1-based indexing for DAY_OF_WEEK
                 "\u65e5",
                 "\u6708",
                 "\u706b",

@@ -90,11 +102,13 @@
                 "\u0e21.\u0e04.",
                 "\u0e01.\u0e1e.",
                 "\u0e21\u0e35.\u0e04.",
                 "\u0e40\u0e21.\u0e22.",
                 "\u0e1e.\u0e04.",
-                "\u0e21\u0e34.\u0e22",  // no last dot
+                (providers.startsWith("CLDR") ?
+                    "\u0e21\u0e34.\u0e22." :
+                    "\u0e21\u0e34.\u0e22"),  // no last dot in JRE
                 "\u0e01.\u0e04.",
                 "\u0e2a.\u0e04.",
                 "\u0e01.\u0e22.",
                 "\u0e15.\u0e04.",
                 "\u0e1e.\u0e22.",