< prev index next >
test/jdk/java/time/tck/java/time/chrono/TCKJapaneseChronology.java
Print this page
rev 54350 : 8205432: Replace the placeholder Japanese era name
Reviewed-by: rriggs
@@ -1,7 +1,7 @@
/*
- o Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ o Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -109,11 +109,13 @@
/**
* Test.
*/
@Test
public class TCKJapaneseChronology {
- private static final int YDIFF_NEWERA = 2018;
+
+ // Year differences from Gregorian years.
+ private static final int YDIFF_REIWA = 2018;
private static final int YDIFF_HEISEI = 1988;
private static final int YDIFF_MEIJI = 1867;
private static final int YDIFF_SHOWA = 1925;
private static final int YDIFF_TAISHO = 1911;
@@ -172,11 +174,11 @@
// creation and cross-checks
//-----------------------------------------------------------------------
@DataProvider(name="createByEra")
Object[][] data_createByEra() {
return new Object[][] {
- {JapaneseEra.of(3), 2020 - YDIFF_NEWERA, 2, 29, 60, LocalDate.of(2020, 2, 29)}, // NEWERA
+ {JapaneseEra.of(3), 2020 - YDIFF_REIWA, 2, 29, 60, LocalDate.of(2020, 2, 29)},
{JapaneseEra.HEISEI, 1996 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(1996, 2, 29)},
{JapaneseEra.HEISEI, 2000 - YDIFF_HEISEI, 2, 29, 60, LocalDate.of(2000, 2, 29)},
{JapaneseEra.MEIJI, 1874 - YDIFF_MEIJI, 2, 28, 59, LocalDate.of(1874, 2, 28)},
{JapaneseEra.SHOWA, 1928 - YDIFF_SHOWA, 12, 25, 360, LocalDate.of(1928, 12, 25)},
{JapaneseEra.TAISHO, 1916 - YDIFF_TAISHO, 7, 30, 212, LocalDate.of(1916, 7, 30)},
@@ -365,12 +367,12 @@
// prolepticYear() and is LeapYear()
//-----------------------------------------------------------------------
@DataProvider(name="prolepticYear")
Object[][] data_prolepticYear() {
return new Object[][] {
- {3, JapaneseEra.of(3), 1, 1 + YDIFF_NEWERA, false}, // NEWERA
- {3, JapaneseEra.of(3), 102, 102 + YDIFF_NEWERA, true}, // NEWERA
+ {3, JapaneseEra.of(3), 1, 1 + YDIFF_REIWA, false},
+ {3, JapaneseEra.of(3), 102, 102 + YDIFF_REIWA, true},
{2, JapaneseEra.HEISEI, 1, 1 + YDIFF_HEISEI, false},
{2, JapaneseEra.HEISEI, 4, 4 + YDIFF_HEISEI, true},
{-1, JapaneseEra.MEIJI, 9, 9 + YDIFF_MEIJI, true},
@@ -551,11 +553,11 @@
return new Object[][] {
{ JapaneseEra.MEIJI, -1, "Meiji"},
{ JapaneseEra.TAISHO, 0, "Taisho"},
{ JapaneseEra.SHOWA, 1, "Showa"},
{ JapaneseEra.HEISEI, 2, "Heisei"},
- { JapaneseEra.of(3), 3, "NewEra"}, // NEWERA
+ { JapaneseEra.of(3), 3, "Reiwa"},
};
}
@Test(dataProvider="japaneseEras")
public void test_Japanese_Eras(Era era, int eraValue, String name) {
@@ -687,11 +689,11 @@
{JapaneseChronology.INSTANCE.date(1926, 12, 24), "Japanese Taisho 15-12-24"},
{JapaneseChronology.INSTANCE.date(1926, 12, 25), "Japanese Showa 1-12-25"},
{JapaneseChronology.INSTANCE.date(1989, 1, 7), "Japanese Showa 64-01-07"},
{JapaneseChronology.INSTANCE.date(1989, 1, 8), "Japanese Heisei 1-01-08"},
{JapaneseChronology.INSTANCE.date(2012, 12, 6), "Japanese Heisei 24-12-06"},
- {JapaneseChronology.INSTANCE.date(2020, 1, 6), "Japanese NewEra 2-01-06"},
+ {JapaneseChronology.INSTANCE.date(2020, 1, 6), "Japanese Reiwa 2-01-06"},
};
}
@Test(dataProvider="toString")
public void test_toString(JapaneseDate jdate, String expected) {
< prev index next >