1 /*
2  * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
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
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 /*
25  * This file is available under and governed by the GNU General Public
26  * License version 2 only, as published by the Free Software Foundation.
27  * However, the following notice accompanied the original version of this
28  * file:
29  *
30  * Copyright (c) 2012, Stephen Colebourne & Michael Nascimento Santos
31  *
32  * All rights reserved.
33  *
34  * Redistribution and use in source and binary forms, with or without
35  * modification, are permitted provided that the following conditions are met:
36  *
37  *  * Redistributions of source code must retain the above copyright notice,
38  *    this list of conditions and the following disclaimer.
39  *
40  *  * Redistributions in binary form must reproduce the above copyright notice,
41  *    this list of conditions and the following disclaimer in the documentation
42  *    and/or other materials provided with the distribution.
43  *
44  *  * Neither the name of JSR-310 nor the names of its contributors
45  *    may be used to endorse or promote products derived from this software
46  *    without specific prior written permission.
47  *
48  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
49  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
51  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
52  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
53  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
54  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
55  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
56  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
57  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
58  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59  */
60 package tck.java.time.chrono;
61 
62 import static org.testng.Assert.assertEquals;
63 import static org.testng.Assert.assertNotNull;
64 import static org.testng.Assert.assertSame;
65 import static org.testng.Assert.assertTrue;
66 
67 import java.io.ByteArrayInputStream;
68 import java.io.ByteArrayOutputStream;
69 import java.io.ObjectInputStream;
70 import java.io.ObjectOutputStream;
71 import java.time.Clock;
72 import java.time.DateTimeException;
73 import java.time.LocalDate;
74 import java.time.LocalTime;
75 import java.time.OffsetDateTime;
76 import java.time.ZoneId;
77 import java.time.ZoneOffset;
78 import java.time.chrono.ChronoLocalDate;
79 import java.time.chrono.Chronology;
80 import java.time.chrono.Era;
81 import java.time.chrono.HijrahChronology;
82 import java.time.chrono.HijrahEra;
83 import java.time.chrono.IsoChronology;
84 import java.time.chrono.IsoEra;
85 import java.time.chrono.JapaneseChronology;
86 import java.time.chrono.JapaneseEra;
87 import java.time.chrono.MinguoChronology;
88 import java.time.chrono.MinguoEra;
89 import java.time.chrono.ThaiBuddhistChronology;
90 import java.time.chrono.ThaiBuddhistEra;
91 import java.time.format.TextStyle;
92 import java.time.temporal.ChronoField;
93 import java.util.Locale;
94 import java.util.Set;
95 
96 import org.testng.annotations.DataProvider;
97 import org.testng.annotations.Test;
98 
99 /**
100  * Test Chronology class.
101  */
102 @Test
103 public class TCKChronology {
104 
105     private static final ZoneOffset OFFSET_P0100 = ZoneOffset.ofHours(1);
106     private static final ZoneOffset OFFSET_M0100 = ZoneOffset.ofHours(-1);
107 
108     private static final int YDIFF_MEIJI = 1867;
109     private static final int YDIFF_SHOWA = 1925;
110     private static final int YDIFF_HEISEI = 1988;
111     private static final int YDIFF_MINGUO = 1911;
112     private static final int YDIFF_THAIBUDDHIST = 543;
113     //-----------------------------------------------------------------------
114     // regular data factory for ID and calendarType of available calendars
115     //-----------------------------------------------------------------------
116     @DataProvider(name = "calendarNameAndType")
data_of_calendars()117     Object[][] data_of_calendars() {
118         return new Object[][] {
119                     {"Hijrah-umalqura", "islamic-umalqura"},
120                     {"ISO", "iso8601"},
121                     {"Japanese", "japanese"},
122                     {"Minguo", "roc"},
123                     {"ThaiBuddhist", "buddhist"},
124                 };
125     }
126 
127     @Test(dataProvider = "calendarNameAndType")
test_getters(String chronoId, String calendarSystemType)128     public void test_getters(String chronoId, String calendarSystemType) {
129         Chronology chrono = Chronology.of(chronoId);
130         assertNotNull(chrono, "Required calendar not found by ID: " + chronoId);
131         assertEquals(chrono.getId(), chronoId);
132         assertEquals(chrono.getCalendarType(), calendarSystemType);
133     }
134 
135     @Test(dataProvider = "calendarNameAndType")
test_required_calendars(String chronoId, String calendarSystemType)136     public void test_required_calendars(String chronoId, String calendarSystemType) {
137         Chronology chrono = Chronology.of(chronoId);
138         assertNotNull(chrono, "Required calendar not found by ID: " + chronoId);
139         chrono = Chronology.of(calendarSystemType);
140         assertNotNull(chrono, "Required calendar not found by type: " + chronoId);
141         Set<Chronology> cals = Chronology.getAvailableChronologies();
142         assertTrue(cals.contains(chrono), "Required calendar not found in set of available calendars");
143     }
144 
145     @Test
test_calendar_list()146     public void test_calendar_list() {
147         Set<Chronology> chronos = Chronology.getAvailableChronologies();
148         assertNotNull(chronos, "Required list of calendars must be non-null");
149         for (Chronology chrono : chronos) {
150             Chronology lookup = Chronology.of(chrono.getId());
151             assertNotNull(lookup, "Required calendar not found: " + chrono);
152         }
153         assertEquals(chronos.size() >= data_of_calendars().length, true, "Chronology.getAvailableChronologies().size = " + chronos.size()
154                 + ", expected >= " + data_of_calendars().length);
155     }
156 
157     //-----------------------------------------------------------------------
158     // getDisplayName()
159     //-----------------------------------------------------------------------
160     @DataProvider(name = "calendarDisplayName")
data_of_calendarDisplayNames()161     Object[][] data_of_calendarDisplayNames() {
162         return new Object[][] {
163                     {"Hijrah", "Islamic Calendar (Umm al-Qura)"},
164                     {"ISO", "ISO"},
165                     {"Japanese", "Japanese Calendar"},
166                     {"Minguo", "Minguo Calendar"},
167                     {"ThaiBuddhist", "Buddhist Calendar"},
168                 };
169     }
170 
171     @Test(dataProvider = "calendarDisplayName")
test_getDisplayName(String chronoId, String calendarDisplayName)172     public void test_getDisplayName(String chronoId, String calendarDisplayName) {
173         Chronology chrono = Chronology.of(chronoId);
174         assertEquals(chrono.getDisplayName(TextStyle.FULL, Locale.ENGLISH), calendarDisplayName);
175     }
176 
177     /**
178      * Compute the number of days from the Epoch and compute the date from the number of days.
179      */
180     @Test(dataProvider = "calendarNameAndType")
test_epoch(String name, String alias)181     public void test_epoch(String name, String alias) {
182         Chronology chrono = Chronology.of(name); // a chronology. In practice this is rarely hardcoded
183         ChronoLocalDate date1 = chrono.dateNow();
184         long epoch1 = date1.getLong(ChronoField.EPOCH_DAY);
185         ChronoLocalDate date2 = date1.with(ChronoField.EPOCH_DAY, epoch1);
186         assertEquals(date1, date2, "Date from epoch day is not same date: " + date1 + " != " + date2);
187         long epoch2 = date1.getLong(ChronoField.EPOCH_DAY);
188         assertEquals(epoch1, epoch2, "Epoch day not the same: " + epoch1 + " != " + epoch2);
189     }
190 
191     @Test(dataProvider = "calendarNameAndType")
test_dateEpochDay(String name, String alias)192     public void test_dateEpochDay(String name, String alias) {
193         Chronology chrono = Chronology.of(name);
194         ChronoLocalDate date = chrono.dateNow();
195         long epochDay = date.getLong(ChronoField.EPOCH_DAY);
196         ChronoLocalDate test = chrono.dateEpochDay(epochDay);
197         assertEquals(test, date);
198     }
199 
200     //-----------------------------------------------------------------------
201     // locale based lookup
202     //-----------------------------------------------------------------------
203     @DataProvider(name = "calendarsystemtype")
data_CalendarType()204     Object[][] data_CalendarType() {
205         return new Object[][] {
206             {HijrahChronology.INSTANCE, "islamic-umalqura"},
207             {IsoChronology.INSTANCE, "iso8601"},
208             {JapaneseChronology.INSTANCE, "japanese"},
209             {MinguoChronology.INSTANCE, "roc"},
210             {ThaiBuddhistChronology.INSTANCE, "buddhist"},
211         };
212     }
213 
214     @Test(dataProvider = "calendarsystemtype")
test_getCalendarType(Chronology chrono, String calendarType)215     public void test_getCalendarType(Chronology chrono, String calendarType) {
216         String type = calendarType;
217         assertEquals(chrono.getCalendarType(), type);
218     }
219 
220     @Test(dataProvider = "calendarsystemtype")
test_lookupLocale(Chronology chrono, String calendarType)221     public void test_lookupLocale(Chronology chrono, String calendarType) {
222         Locale.Builder builder = new Locale.Builder().setLanguage("en").setRegion("CA");
223         builder.setUnicodeLocaleKeyword("ca", calendarType);
224         Locale locale = builder.build();
225         assertEquals(Chronology.ofLocale(locale), chrono);
226     }
227 
228     //-----------------------------------------------------------------------
229     // dateNow()
230     //-----------------------------------------------------------------------
231     @Test
test_MinguoChronology_dateNow()232     public void test_MinguoChronology_dateNow() {
233         ZoneId zoneId_paris = ZoneId.of("Europe/Paris");
234         Clock clock = Clock.system(zoneId_paris);
235 
236         Chronology chrono = Chronology.of("Minguo");
237         assertEquals(chrono.dateNow(), MinguoChronology.INSTANCE.dateNow());
238         assertEquals(chrono.dateNow(zoneId_paris), MinguoChronology.INSTANCE.dateNow(zoneId_paris));
239         assertEquals(chrono.dateNow(clock), MinguoChronology.INSTANCE.dateNow(clock));
240     }
241 
242     @Test
test_IsoChronology_dateNow()243     public void test_IsoChronology_dateNow() {
244         ZoneId zoneId_paris = ZoneId.of("Europe/Paris");
245         Clock clock = Clock.system(zoneId_paris);
246 
247         Chronology chrono = Chronology.of("ISO");
248         assertEquals(chrono.dateNow(), IsoChronology.INSTANCE.dateNow());
249         assertEquals(chrono.dateNow(zoneId_paris), IsoChronology.INSTANCE.dateNow(zoneId_paris));
250         assertEquals(chrono.dateNow(clock), IsoChronology.INSTANCE.dateNow(clock));
251     }
252 
253     @Test
test_JapaneseChronology_dateNow()254     public void test_JapaneseChronology_dateNow() {
255         ZoneId zoneId_paris = ZoneId.of("Europe/Paris");
256         Clock clock = Clock.system(zoneId_paris);
257 
258         Chronology chrono = Chronology.of("Japanese");
259         assertEquals(chrono.dateNow(), JapaneseChronology.INSTANCE.dateNow());
260         assertEquals(chrono.dateNow(zoneId_paris), JapaneseChronology.INSTANCE.dateNow(zoneId_paris));
261         assertEquals(chrono.dateNow(clock), JapaneseChronology.INSTANCE.dateNow(clock));
262     }
263 
264     @Test
test_ThaiBuddhistChronology_dateNow()265     public void test_ThaiBuddhistChronology_dateNow() {
266         ZoneId zoneId_paris = ZoneId.of("Europe/Paris");
267         Clock clock = Clock.system(zoneId_paris);
268 
269         Chronology chrono = Chronology.of("ThaiBuddhist");
270         assertEquals(chrono.dateNow(), ThaiBuddhistChronology.INSTANCE.dateNow());
271         assertEquals(chrono.dateNow(zoneId_paris), ThaiBuddhistChronology.INSTANCE.dateNow(zoneId_paris));
272         assertEquals(chrono.dateNow(clock), ThaiBuddhistChronology.INSTANCE.dateNow(clock));
273     }
274 
275     //-----------------------------------------------------------------------
276     // dateYearDay() and date()
277     //-----------------------------------------------------------------------
278     @Test
test_HijrahChronology_dateYearDay()279     public void test_HijrahChronology_dateYearDay() {
280         Chronology chrono = Chronology.of("Hijrah");
281         ChronoLocalDate date1 = chrono.dateYearDay(HijrahEra.AH, 1434, 178);
282         ChronoLocalDate date2 = chrono.date(HijrahEra.AH, 1434, 7, 1);
283         assertEquals(date1, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
284         assertEquals(date2, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
285     }
286 
287     @Test
test_MinguoChronology_dateYearDay()288     public void test_MinguoChronology_dateYearDay() {
289         Chronology chrono = Chronology.of("Minguo");
290         ChronoLocalDate date1 = chrono.dateYearDay(MinguoEra.ROC, 5, 60);
291         ChronoLocalDate date2 = chrono.date(MinguoEra.ROC, 5, 2, 29);
292         assertEquals(date1, MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 5, 60));
293         assertEquals(date2, MinguoChronology.INSTANCE.dateYearDay(MinguoEra.ROC, 5, 60));
294     }
295 
296     @Test
test_IsoChronology_dateYearDay()297     public void test_IsoChronology_dateYearDay() {
298         Chronology chrono = Chronology.of("ISO");
299         ChronoLocalDate date1 = chrono.dateYearDay(IsoEra.CE, 5, 60);
300         ChronoLocalDate date2 = chrono.date(IsoEra.CE, 5, 3, 1);
301         assertEquals(date1, IsoChronology.INSTANCE.dateYearDay(IsoEra.CE, 5, 60));
302         assertEquals(date2, IsoChronology.INSTANCE.dateYearDay(IsoEra.CE, 5, 60));
303     }
304 
305     @Test
test_JapaneseChronology_dateYearDay()306     public void test_JapaneseChronology_dateYearDay() {
307         Chronology chrono = Chronology.of("Japanese");
308         ChronoLocalDate date1 = chrono.dateYearDay(JapaneseEra.HEISEI, 8, 60);
309         ChronoLocalDate date2 = chrono.date(JapaneseEra.HEISEI, 8, 2, 29);
310         assertEquals(date1, JapaneseChronology.INSTANCE.dateYearDay(JapaneseEra.HEISEI, 8, 60));
311         assertEquals(date2, JapaneseChronology.INSTANCE.dateYearDay(JapaneseEra.HEISEI, 8, 60));
312     }
313 
314     @Test
test_ThaiBuddhistChronology_dateYearDay()315     public void test_ThaiBuddhistChronology_dateYearDay() {
316         Chronology chrono = Chronology.of("ThaiBuddhist");
317         ChronoLocalDate date1 = chrono.dateYearDay(ThaiBuddhistEra.BE, 2459, 60);
318         ChronoLocalDate date2 = chrono.date(ThaiBuddhistEra.BE, 2459, 2, 29);
319         assertEquals(date1, ThaiBuddhistChronology.INSTANCE.dateYearDay(ThaiBuddhistEra.BE, 2459, 60));
320         assertEquals(date2, ThaiBuddhistChronology.INSTANCE.dateYearDay(ThaiBuddhistEra.BE, 2459, 60));
321     }
322 
323     /**
324      * Test lookup by calendarType of each chronology.
325      * Verify that the calendar can be found by {@link java.time.chrono.Chronology#ofLocale}.
326      */
327     @Test
test_ofLocaleByType()328     public void test_ofLocaleByType() {
329         // Test that all available chronologies can be successfully found using ofLocale
330         Set<Chronology> chronos = Chronology.getAvailableChronologies();
331         for (Chronology chrono : chronos) {
332             Locale.Builder builder = new Locale.Builder().setLanguage("en").setRegion("CA");
333             builder.setUnicodeLocaleKeyword("ca", chrono.getCalendarType());
334             Locale locale = builder.build();
335             assertEquals(Chronology.ofLocale(locale), chrono, "Lookup by type");
336         }
337     }
338 
339     @Test(expectedExceptions = DateTimeException.class)
test_lookupLocale()340     public void test_lookupLocale() {
341         Locale.Builder builder = new Locale.Builder().setLanguage("en").setRegion("CA");
342         builder.setUnicodeLocaleKeyword("ca", "xxx");
343 
344         Locale locale = builder.build();
345         Chronology.ofLocale(locale);
346     }
347 
348     @Test(expectedExceptions = DateTimeException.class)
test_noChrono()349     public void test_noChrono() {
350         Chronology chrono = Chronology.of("FooFoo");
351     }
352 
353     @DataProvider(name = "epochSecond_dataProvider")
data_epochSecond()354     Object[][]  data_epochSecond() {
355         return new Object[][] {
356                 {JapaneseChronology.INSTANCE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
357                 {JapaneseChronology.INSTANCE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
358                 {JapaneseChronology.INSTANCE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},
359                 {HijrahChronology.INSTANCE, 1434, 9, 7, 1, 2, 2, OFFSET_P0100},
360                 {MinguoChronology.INSTANCE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
361                 {MinguoChronology.INSTANCE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
362                 {MinguoChronology.INSTANCE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},
363                 {ThaiBuddhistChronology.INSTANCE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
364                 {ThaiBuddhistChronology.INSTANCE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
365                 {ThaiBuddhistChronology.INSTANCE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},
366                 {IsoChronology.INSTANCE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
367                 {IsoChronology.INSTANCE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
368                 {IsoChronology.INSTANCE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},
369 
370         };
371     }
372 
373     @Test(dataProvider = "epochSecond_dataProvider")
test_epochSecond(Chronology chrono, int y, int m, int d, int h, int min, int s, ZoneOffset offset)374     public void test_epochSecond(Chronology chrono, int y, int m, int d, int h, int min, int s, ZoneOffset offset) {
375         ChronoLocalDate chronoLd = chrono.date(y, m, d);
376         assertEquals(chrono.epochSecond(y, m, d, h, min, s, offset),
377                      OffsetDateTime.of(LocalDate.from(chronoLd), LocalTime.of(h, min, s), offset)
378                                    .toEpochSecond());
379     }
380 
381     @DataProvider(name = "era_epochSecond_dataProvider")
data_era_epochSecond()382     Object[][]  data_era_epochSecond() {
383         return new Object[][] {
384                 {JapaneseChronology.INSTANCE, JapaneseEra.MEIJI, 1873 - YDIFF_MEIJI, 9, 7, 1, 2, 2, OFFSET_P0100},
385                 {JapaneseChronology.INSTANCE, JapaneseEra.SHOWA, 1928 - YDIFF_SHOWA, 2, 28, 1, 2, 2, OFFSET_M0100},
386                 {JapaneseChronology.INSTANCE, JapaneseEra.HEISEI, 1989 - YDIFF_HEISEI, 1, 8, 1, 2, 2, OFFSET_P0100},
387                 {HijrahChronology.INSTANCE, HijrahEra.AH, 1434, 9, 7, 1, 2, 2, OFFSET_P0100},
388                 {MinguoChronology.INSTANCE, MinguoEra.BEFORE_ROC, 1873 - YDIFF_MINGUO, 9, 7, 1, 2, 2, OFFSET_P0100},
389                 {MinguoChronology.INSTANCE, MinguoEra.ROC, 1928 - YDIFF_MINGUO, 2, 28, 1, 2, 2, OFFSET_M0100},
390                 {MinguoChronology.INSTANCE, MinguoEra.ROC, 1989 - YDIFF_MINGUO, 1, 8, 1, 2, 2, OFFSET_P0100},
391                 {ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1873 + YDIFF_THAIBUDDHIST, 9, 7, 1, 2, 2, OFFSET_P0100},
392                 {ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1928 + YDIFF_THAIBUDDHIST, 2, 28, 1, 2, 2, OFFSET_M0100},
393                 {ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1989 + YDIFF_THAIBUDDHIST, 1, 8, 1, 2, 2, OFFSET_P0100},
394                 {IsoChronology.INSTANCE, IsoEra.CE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
395                 {IsoChronology.INSTANCE, IsoEra.CE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
396                 {IsoChronology.INSTANCE, IsoEra.CE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},
397 
398         };
399     }
400 
401     @Test(dataProvider = "era_epochSecond_dataProvider")
test_epochSecond(Chronology chrono, Era era, int y, int m, int d, int h, int min, int s, ZoneOffset offset)402     public void test_epochSecond(Chronology chrono, Era era, int y, int m, int d, int h, int min, int s, ZoneOffset offset) {
403         ChronoLocalDate chronoLd = chrono.date(era, y, m, d);
404         assertEquals(chrono.epochSecond(era, y, m, d, h, min, s, offset),
405                      OffsetDateTime.of(LocalDate.from(chronoLd), LocalTime.of(h, min, s), offset)
406                                    .toEpochSecond());
407     }
408 
409     @DataProvider(name = "bad_epochSecond_dataProvider")
bad_data_epochSecond()410     Object[][]  bad_data_epochSecond() {
411         return new Object[][] {
412                 {JapaneseChronology.INSTANCE, 1873, 13, 7, 1, 2, 2, OFFSET_P0100},
413                 {HijrahChronology.INSTANCE, 1434, 9, 32, 1, 2, 2, OFFSET_P0100},
414                 {MinguoChronology.INSTANCE, 1873, 9, 7, 31, 2, 2, OFFSET_P0100},
415                 {ThaiBuddhistChronology.INSTANCE, 1928, 2, 28, -1, 2, 2, OFFSET_M0100},
416                 {IsoChronology.INSTANCE, 1928, 2, 28, 1, 60, 2, OFFSET_M0100},
417                 {IsoChronology.INSTANCE, 1989, 1, 8, 1, 2, -2, OFFSET_P0100},
418 
419         };
420     }
421 
422     @Test(dataProvider = "bad_epochSecond_dataProvider", expectedExceptions = DateTimeException.class)
test_bad_epochSecond(Chronology chrono, int y, int m, int d, int h, int min, int s, ZoneOffset offset)423     public void test_bad_epochSecond(Chronology chrono, int y, int m, int d, int h, int min, int s, ZoneOffset offset) {
424         chrono.epochSecond(y, m, d, h, min, s, offset);
425     }
426 
427 }
428