< prev index next >

test/jdk/sun/util/calendar/zi/TestZoneInfo310.java

Print this page
rev 55760 : [mq]: 8212970


 157             TimeZone.getTimeZone(zid);
 158         }
 159         t1 = System.currentTimeMillis();
 160         System.out.printf("NEW.TotalTZ()=%d (ms)%n", t1 - t0);
 161 
 162         if (!Arrays.equals(zids_old, zids_new)) {
 163             throw new RuntimeException("  FAILED:  availableIds don't match");
 164         }
 165 
 166         if (!Arrays.equals(alias_old, alias_new)) {
 167             throw new RuntimeException("  FAILED:  aliases don't match");
 168         }
 169 
 170         for (String zid : zids_new) {
 171             ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid));
 172             ZoneInfoOld ziOLD = (ZoneInfoOld)ZoneInfoOld.getTimeZone(zid);
 173             /*
 174              * Temporary ignoring the failing TimeZones which are having zone
 175              * rules defined till year 2037 and/or above and have negative DST
 176              * save time in IANA tzdata. This bug is tracked via JDK-8223388.













 177              */
 178             if (zid.equals("Africa/Casablanca") || zid.equals("Africa/El_Aaiun")
 179                 || zid.equals("Asia/Tehran") || zid.equals("Iran")) {







 180                 continue;
 181             }
 182             if (! zi.equalsTo(ziOLD)) {
 183                 System.out.println(zi.diffsTo(ziOLD));
 184                 throw new RuntimeException("  FAILED:  " + zid);
 185             }
 186         }
 187         delete(fZidir);
 188 
 189         // test tzdb version
 190         if (!ver.equals(sun.util.calendar.ZoneInfoFile.getVersion())) {
 191             System.out.printf("  FAILED:  ver=%s, expected=%s%n",
 192                               sun.util.calendar.ZoneInfoFile.getVersion(), ver);
 193             throw new RuntimeException("Version test failed");
 194         }
 195 
 196         // test getAvailableIDs(raw);
 197         zids_new = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
 198         //Arrays.sort(zids_new);
 199         zids_old = ZoneInfoOld.getAvailableIDs(-8 * 60 * 60 * 1000);




 157             TimeZone.getTimeZone(zid);
 158         }
 159         t1 = System.currentTimeMillis();
 160         System.out.printf("NEW.TotalTZ()=%d (ms)%n", t1 - t0);
 161 
 162         if (!Arrays.equals(zids_old, zids_new)) {
 163             throw new RuntimeException("  FAILED:  availableIds don't match");
 164         }
 165 
 166         if (!Arrays.equals(alias_old, alias_new)) {
 167             throw new RuntimeException("  FAILED:  aliases don't match");
 168         }
 169 
 170         for (String zid : zids_new) {
 171             ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid));
 172             ZoneInfoOld ziOLD = (ZoneInfoOld)ZoneInfoOld.getTimeZone(zid);
 173             /*
 174              * Temporary ignoring the failing TimeZones which are having zone
 175              * rules defined till year 2037 and/or above and have negative DST
 176              * save time in IANA tzdata. This bug is tracked via JDK-8223388.
 177              *
 178              * These are the zones/rules that employ negative DST in vanguard
 179              * format (as of 2019a):
 180              *
 181              *  - Rule "Eire"
 182              *  - Rule "Morocco"
 183              *  - Rule "Namibia"
 184              *  - Zone "Europe/Prague"
 185              *
 186              * Tehran/Iran rule has rules beyond 2037, in which javazic assumes
 187              * to be the last year. Thus javazic's rule is based on year 2037
 188              * (Mar 20th/Sep 20th are the cutover dates), while the real rule
 189              * has year 2087 where Mar 21st/Sep 21st are the cutover dates.
 190              */
 191             if (zid.equals("Africa/Casablanca") || // uses "Morocco" rule
 192                 zid.equals("Africa/El_Aaiun") || // uses "Morocco" rule
 193                 zid.equals("Africa/Windhoek") || // uses "Namibia" rule
 194                 zid.equals("Eire") ||
 195                 zid.equals("Europe/Bratislava") || // link to "Europe/Prague"
 196                 zid.equals("Europe/Dublin") || // uses "Eire" rule
 197                 zid.equals("Europe/Prague") ||
 198                 zid.equals("Asia/Tehran") || // last rule mismatch
 199                 zid.equals("Iran")) { // last rule mismatch
 200                     continue;
 201             }
 202             if (! zi.equalsTo(ziOLD)) {
 203                 System.out.println(zi.diffsTo(ziOLD));
 204                 throw new RuntimeException("  FAILED:  " + zid);
 205             }
 206         }
 207         delete(fZidir);
 208 
 209         // test tzdb version
 210         if (!ver.equals(sun.util.calendar.ZoneInfoFile.getVersion())) {
 211             System.out.printf("  FAILED:  ver=%s, expected=%s%n",
 212                               sun.util.calendar.ZoneInfoFile.getVersion(), ver);
 213             throw new RuntimeException("Version test failed");
 214         }
 215 
 216         // test getAvailableIDs(raw);
 217         zids_new = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
 218         //Arrays.sort(zids_new);
 219         zids_old = ZoneInfoOld.getAvailableIDs(-8 * 60 * 60 * 1000);


< prev index next >