1 /*
2 * Copyright (c) 2013, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
758 {HijrahDate.of(1434,5,1), ThaiBuddhistDate.of(2556,3,13)},
759 {HijrahDate.of(1436,1,1), ThaiBuddhistDate.of(2557,10,25)},
760 {HijrahDate.of(1500,6,12), ThaiBuddhistDate.of(2620,5,5)},
761 {HijrahDate.of(1550,3,11), ThaiBuddhistDate.of(2668,8,11)},
762 };
763 }
764
765 // Test to verify the date conversion from Hijrah to Thai chronology
766 @Test(dataProvider="hijrahToThai")
767 public void test_hijrahToThai(HijrahDate hijrah, ThaiBuddhistDate thai) {
768 assertEquals(ThaiBuddhistChronology.INSTANCE.date(hijrah), thai);
769 }
770
771 // Sample Hijrah & Japanese Dates
772 @DataProvider(name="hijrahToJapanese")
773 Object[][] data_hijrahToJapanese() {
774 return new Object[][] {
775 {HijrahDate.of(1350,5,15), "Japanese Showa 6-09-28"},
776 {HijrahDate.of(1434,5,1), "Japanese Heisei 25-03-13"},
777 {HijrahDate.of(1436,1,1), "Japanese Heisei 26-10-25"},
778 {HijrahDate.of(1500,6,12), "Japanese Heisei 89-05-05"},
779 {HijrahDate.of(1550,3,11), "Japanese Heisei 137-08-11"},
780 };
781 }
782
783 // Test to verify the date conversion from Hijrah to Japanese chronology
784 @Test(dataProvider="hijrahToJapanese")
785 public void test_hijrahToJapanese(HijrahDate hijrah, String japanese) {
786 assertEquals(JapaneseChronology.INSTANCE.date(hijrah).toString(), japanese);
787 }
788 }
|
1 /*
2 * Copyright (c) 2013, 2019, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
758 {HijrahDate.of(1434,5,1), ThaiBuddhistDate.of(2556,3,13)},
759 {HijrahDate.of(1436,1,1), ThaiBuddhistDate.of(2557,10,25)},
760 {HijrahDate.of(1500,6,12), ThaiBuddhistDate.of(2620,5,5)},
761 {HijrahDate.of(1550,3,11), ThaiBuddhistDate.of(2668,8,11)},
762 };
763 }
764
765 // Test to verify the date conversion from Hijrah to Thai chronology
766 @Test(dataProvider="hijrahToThai")
767 public void test_hijrahToThai(HijrahDate hijrah, ThaiBuddhistDate thai) {
768 assertEquals(ThaiBuddhistChronology.INSTANCE.date(hijrah), thai);
769 }
770
771 // Sample Hijrah & Japanese Dates
772 @DataProvider(name="hijrahToJapanese")
773 Object[][] data_hijrahToJapanese() {
774 return new Object[][] {
775 {HijrahDate.of(1350,5,15), "Japanese Showa 6-09-28"},
776 {HijrahDate.of(1434,5,1), "Japanese Heisei 25-03-13"},
777 {HijrahDate.of(1436,1,1), "Japanese Heisei 26-10-25"},
778 {HijrahDate.of(1440,8,25), "Japanese Heisei 31-04-30"},
779 {HijrahDate.of(1440,8,26), "Japanese NewEra 1-05-01"},
780 {HijrahDate.of(1500,6,12), "Japanese NewEra 59-05-05"},
781 {HijrahDate.of(1550,3,11), "Japanese NewEra 107-08-11"},
782 };
783 }
784
785 // Test to verify the date conversion from Hijrah to Japanese chronology
786 @Test(dataProvider="hijrahToJapanese")
787 public void test_hijrahToJapanese(HijrahDate hijrah, String japanese) {
788 assertEquals(JapaneseChronology.INSTANCE.date(hijrah).toString(), japanese);
789 }
790 }
|