/[packages]/updates/8/java-1.8.0-openjdk/current/SOURCES/TestTranslations.java
ViewVC logotype

Diff of /updates/8/java-1.8.0-openjdk/current/SOURCES/TestTranslations.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1936261 by ns80, Fri Nov 4 09:10:46 2022 UTC revision 1936262 by ns80, Thu Jan 26 15:13:21 2023 UTC
# Line 30  import java.util.TimeZone; Line 30  import java.util.TimeZone;
30    
31  public class TestTranslations {  public class TestTranslations {
32    
33      private static Map<Locale,String[]> KYIV;      private static Map<Locale,String[]> KYIV, CIUDAD_JUAREZ;
34    
35      static {      static {
36          Map<Locale,String[]> map = new HashMap<Locale,String[]>();          Map<Locale,String[]> map = new HashMap<Locale,String[]>();
# Line 44  public class TestTranslations { Line 44  public class TestTranslations {
44                                                 "Osteurop\u00e4ische Sommerzeit", "OESZ", "OESZ",                                                 "Osteurop\u00e4ische Sommerzeit", "OESZ", "OESZ",
45                                                 "Osteurop\u00e4ische Zeit", "OEZ", "OEZ"});                                                 "Osteurop\u00e4ische Zeit", "OEZ", "OEZ"});
46          KYIV = Collections.unmodifiableMap(map);          KYIV = Collections.unmodifiableMap(map);
47    
48            map = new HashMap<Locale,String[]>();
49            map.put(Locale.US, new String[] { "Mountain Standard Time", "MST", "MST",
50                                              "Mountain Daylight Time", "MDT", "MDT",
51                                              "Mountain Time", "MT", "MT"});
52            map.put(Locale.FRANCE, new String[] { "Heure normale des Rocheuses", "UTC\u221207:00", "MST",
53                                                  "Heure avanc\u00e9e des Rocheuses", "UTC\u221206:00", "MDT",
54                                                  "Rocheuses", "UTC\u221207:00", "MT"});
55            map.put(Locale.GERMANY, new String[] { "Rocky Mountains Normalzeit", "GMT-07:00", "MST",
56                                                   "Rocky Mountains Sommerzeit", "GMT-06:00", "MDT",
57                                                   "Zeitzone Mountain", "GMT-07:00", "MT"});
58            CIUDAD_JUAREZ = Collections.unmodifiableMap(map);
59      }      }
60    
61    
# Line 53  public class TestTranslations { Line 65  public class TestTranslations {
65              System.exit(1);              System.exit(1);
66          }          }
67    
         String localeProvider = args[0];  
68          System.out.println("Checking sanity of full zone string set...");          System.out.println("Checking sanity of full zone string set...");
69          boolean invalid = Arrays.stream(Locale.getAvailableLocales())          boolean invalid = Arrays.stream(Locale.getAvailableLocales())
70              .peek(l -> System.out.println("Locale: " + l))              .peek(l -> System.out.println("Locale: " + l))
# Line 68  public class TestTranslations { Line 79  public class TestTranslations {
79              System.exit(2);              System.exit(2);
80          }          }
81    
82          for (Locale l : KYIV.keySet()) {          String localeProvider = args[0];
83              String[] expected = KYIV.get(l);          testZone(localeProvider, KYIV,
84              for (String id : new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" }) {                   new String[] { "Europe/Kiev", "Europe/Kyiv", "Europe/Uzhgorod", "Europe/Zaporozhye" });
85            testZone(localeProvider, CIUDAD_JUAREZ,
86                     new String[] { "America/Cambridge_Bay", "America/Ciudad_Juarez" });
87        }
88    
89        private static void testZone(String localeProvider, Map<Locale,String[]> exp, String[] ids) {
90            for (Locale l : exp.keySet()) {
91                String[] expected = exp.get(l);
92                System.out.printf("Expected values for %s are %s\n", l, Arrays.toString(expected));
93                for (String id : ids) {
94                  String expectedShortStd = null;                  String expectedShortStd = null;
95                  String expectedShortDST = null;                  String expectedShortDST = null;
96                  String expectedShortGen = null;                  String expectedShortGen = null;

Legend:
Removed from v.1936261  
changed lines
  Added in v.1936262

  ViewVC Help
Powered by ViewVC 1.1.30