test/jdk/sun/util/calendar/zi/TestZoneInfo310.java
changeset 55634 0f1e29c77e50
parent 47216 71c04702a3d5
child 57544 99d2dd7b84a8
equal deleted inserted replaced
55633:9d7c2d9f822c 55634:0f1e29c77e50
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8007572 8008161 8157792
    26  * @bug 8007572 8008161 8157792 8224560
    27  * @summary Test whether the TimeZone generated from JSR310 tzdb is the same
    27  * @summary Test whether the TimeZone generated from JSR310 tzdb is the same
    28  * as the one from the tz data from javazic
    28  * as the one from the tz data from javazic
    29  * @modules java.base/sun.util.calendar:+open
    29  * @modules java.base/sun.util.calendar:+open
    30  * @build BackEnd Checksum DayOfWeek Gen GenDoc Main Mappings Month
    30  * @build BackEnd Checksum DayOfWeek Gen GenDoc Main Mappings Month
    31  *        Rule RuleDay RuleRec Simple TestZoneInfo310 Time Timezone
    31  *        Rule RuleDay RuleRec Simple TestZoneInfo310 Time Timezone
   168         }
   168         }
   169 
   169 
   170         for (String zid : zids_new) {
   170         for (String zid : zids_new) {
   171             ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid));
   171             ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid));
   172             ZoneInfoOld ziOLD = (ZoneInfoOld)ZoneInfoOld.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             }
   173             if (! zi.equalsTo(ziOLD)) {
   182             if (! zi.equalsTo(ziOLD)) {
   174                 System.out.println(zi.diffsTo(ziOLD));
   183                 System.out.println(zi.diffsTo(ziOLD));
   175                 throw new RuntimeException("  FAILED:  " + zid);
   184                 throw new RuntimeException("  FAILED:  " + zid);
   176             }
   185             }
   177         }
   186         }