本文整理汇总了Java中java.time.chrono.HijrahDate.range方法的典型用法代码示例。如果您正苦于以下问题:Java HijrahDate.range方法的具体用法?Java HijrahDate.range怎么用?Java HijrahDate.range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.time.chrono.HijrahDate
的用法示例。
在下文中一共展示了HijrahDate.range方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Test_UmmAlQuraRanges
import java.time.chrono.HijrahDate; //导入方法依赖的package包/类
@Test(dataProvider="dates")
public void Test_UmmAlQuraRanges(HijrahDate date,
int minYear, int maxYear,
int minMonth, int maxMonth,
int minDay, int maxDay, int maxChronoDay) {
// Check the chronology ranges
HijrahChronology chrono = date.getChronology();
ValueRange yearRange = chrono.range(YEAR);
assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah chronology");
assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah chronology");
assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah chronology");
assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest Maximum year for Hijrah chronology");
ValueRange monthRange = chrono.range(MONTH_OF_YEAR);
assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for Hijrah chronology");
assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for Hijrah chronology");
ValueRange daysRange = chrono.range(DAY_OF_MONTH);
assertEquals(daysRange.getMinimum(), minDay, "Minimum day for chronology");
assertEquals(daysRange.getMaximum(), maxChronoDay, "Maximum day for Hijrah chronology");
// Check the date ranges
yearRange = date.range(YEAR);
assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah date");
assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah date");
assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah date");
assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest maximum year for Hijrah date");
monthRange = date.range(MONTH_OF_YEAR);
assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for HijrahDate");
assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for HijrahDate");
daysRange = date.range(DAY_OF_MONTH);
assertEquals(daysRange.getMinimum(), minDay, "Minimum day for HijrahDate");
assertEquals(daysRange.getMaximum(), maxDay, "Maximum day for HijrahDate");
}