java.time.chrono.HijrahEra源码实例Demo

类java.time.chrono.HijrahEra源码实例Demo

下面列出了java.time.chrono.HijrahEra 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-jdk9   文件: TCKChronology.java
@DataProvider(name = "era_epochSecond_dataProvider")
Object[][]  data_era_epochSecond() {
    return new Object[][] {
            {JapaneseChronology.INSTANCE, JapaneseEra.MEIJI, 1873 - YDIFF_MEIJI, 9, 7, 1, 2, 2, OFFSET_P0100},
            {JapaneseChronology.INSTANCE, JapaneseEra.SHOWA, 1928 - YDIFF_SHOWA, 2, 28, 1, 2, 2, OFFSET_M0100},
            {JapaneseChronology.INSTANCE, JapaneseEra.HEISEI, 1989 - YDIFF_HEISEI, 1, 8, 1, 2, 2, OFFSET_P0100},
            {HijrahChronology.INSTANCE, HijrahEra.AH, 1434, 9, 7, 1, 2, 2, OFFSET_P0100},
            {MinguoChronology.INSTANCE, MinguoEra.BEFORE_ROC, 1873 - YDIFF_MINGUO, 9, 7, 1, 2, 2, OFFSET_P0100},
            {MinguoChronology.INSTANCE, MinguoEra.ROC, 1928 - YDIFF_MINGUO, 2, 28, 1, 2, 2, OFFSET_M0100},
            {MinguoChronology.INSTANCE, MinguoEra.ROC, 1989 - YDIFF_MINGUO, 1, 8, 1, 2, 2, OFFSET_P0100},
            {ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1873 + YDIFF_THAIBUDDHIST, 9, 7, 1, 2, 2, OFFSET_P0100},
            {ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1928 + YDIFF_THAIBUDDHIST, 2, 28, 1, 2, 2, OFFSET_M0100},
            {ThaiBuddhistChronology.INSTANCE, ThaiBuddhistEra.BE, 1989 + YDIFF_THAIBUDDHIST, 1, 8, 1, 2, 2, OFFSET_P0100},
            {IsoChronology.INSTANCE, IsoEra.CE, 1873, 9, 7, 1, 2, 2, OFFSET_P0100},
            {IsoChronology.INSTANCE, IsoEra.CE, 1928, 2, 28, 1, 2, 2, OFFSET_M0100},
            {IsoChronology.INSTANCE, IsoEra.CE, 1989, 1, 8, 1, 2, 2, OFFSET_P0100},

    };
}
 
源代码2 项目: dragonwell8_jdk   文件: TCKHijrahEra.java
@Test(dataProvider="HijrahEras")
public void test_valueOf(HijrahEra era , String eraName, int eraValue) {
    assertEquals(era.getValue(), eraValue);

    assertEquals(HijrahChronology.INSTANCE.eraOf(eraValue), era);
    assertEquals(HijrahEra.of(eraValue), era);
    assertEquals(HijrahEra.valueOf(eraName), era);
}
 
源代码3 项目: dragonwell8_jdk   文件: TCKHijrahChronology.java
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
    Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
    int i = 0;
    for (ResolverStyle style : ResolverStyle.values()) {
        for (HijrahEra era : HijrahEra.values()) {
            result[i++] = new Object[] {style, era};
        }
    }
    return result;
}
 
源代码4 项目: dragonwell8_jdk   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.size(), 1);
}
 
源代码5 项目: dragonwell8_jdk   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOfEraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR_OF_ERA, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 1);
}
 
源代码6 项目: openjdk-8   文件: TCKHijrahEra.java
@Test(dataProvider="HijrahEras")
public void test_valueOf(HijrahEra era , String eraName, int eraValue) {
    assertEquals(era.getValue(), eraValue);

    assertEquals(HijrahChronology.INSTANCE.eraOf(eraValue), era);
    assertEquals(HijrahEra.of(eraValue), era);
    assertEquals(HijrahEra.valueOf(eraName), era);
}
 
源代码7 项目: TencentKona-8   文件: TCKChronology.java
@Test
public void test_HijrahChronology_dateYearDay() {
    Chronology chrono = Chronology.of("Hijrah");
    ChronoLocalDate date1 = chrono.dateYearDay(HijrahEra.AH, 1434, 178);
    ChronoLocalDate date2 = chrono.date(HijrahEra.AH, 1434, 7, 1);
    assertEquals(date1, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
    assertEquals(date2, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
}
 
源代码8 项目: TencentKona-8   文件: TCKHijrahChronology.java
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
    Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
    int i = 0;
    for (ResolverStyle style : ResolverStyle.values()) {
        for (HijrahEra era : HijrahEra.values()) {
            result[i++] = new Object[] {style, era};
        }
    }
    return result;
}
 
源代码9 项目: TencentKona-8   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.size(), 1);
}
 
源代码10 项目: TencentKona-8   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOfEraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR_OF_ERA, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 1);
}
 
源代码11 项目: TencentKona-8   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 2);
}
 
源代码12 项目: openjdk-8   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOfEraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR_OF_ERA, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 1);
}
 
源代码13 项目: jdk8u60   文件: TCKChronology.java
@Test
public void test_HijrahChronology_dateYearDay() {
    Chronology chrono = Chronology.of("Hijrah");
    ChronoLocalDate date1 = chrono.dateYearDay(HijrahEra.AH, 1434, 178);
    ChronoLocalDate date2 = chrono.date(HijrahEra.AH, 1434, 7, 1);
    assertEquals(date1, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
    assertEquals(date2, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
}
 
源代码14 项目: openjdk-8-source   文件: TCKHijrahEra.java
@Test(dataProvider="HijrahEras")
public void test_valueOf(HijrahEra era , String eraName, int eraValue) {
    assertEquals(era.getValue(), eraValue);

    assertEquals(HijrahChronology.INSTANCE.eraOf(eraValue), era);
    assertEquals(HijrahEra.of(eraValue), era);
    assertEquals(HijrahEra.valueOf(eraName), era);
}
 
源代码15 项目: jdk8u60   文件: TCKHijrahChronology.java
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
    Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
    int i = 0;
    for (ResolverStyle style : ResolverStyle.values()) {
        for (HijrahEra era : HijrahEra.values()) {
            result[i++] = new Object[] {style, era};
        }
    }
    return result;
}
 
源代码16 项目: jdk8u60   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.size(), 1);
}
 
源代码17 项目: jdk8u60   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOfEraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR_OF_ERA, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 1);
}
 
源代码18 项目: jdk8u60   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 2);
}
 
源代码19 项目: openjdk-jdk8u   文件: TCKChronology.java
@Test
public void test_HijrahChronology_dateYearDay() {
    Chronology chrono = Chronology.of("Hijrah");
    ChronoLocalDate date1 = chrono.dateYearDay(HijrahEra.AH, 1434, 178);
    ChronoLocalDate date2 = chrono.date(HijrahEra.AH, 1434, 7, 1);
    assertEquals(date1, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
    assertEquals(date2, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
}
 
源代码20 项目: openjdk-jdk8u   文件: TCKHijrahChronology.java
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
    Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
    int i = 0;
    for (ResolverStyle style : ResolverStyle.values()) {
        for (HijrahEra era : HijrahEra.values()) {
            result[i++] = new Object[] {style, era};
        }
    }
    return result;
}
 
源代码21 项目: openjdk-jdk8u   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.size(), 1);
}
 
源代码22 项目: openjdk-jdk8u   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOfEraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR_OF_ERA, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR_OF_ERA), null);
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 1);
}
 
源代码23 项目: openjdk-jdk8u   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 2);
}
 
源代码24 项目: openjdk-jdk8u   文件: TCKEraSerialization.java
@DataProvider(name = "Eras")
Era[][] data_of_calendars() {
    return new Era[][] {
                {HijrahEra.AH},
                {IsoEra.BCE},
                {IsoEra.CE},
                {MinguoEra.BEFORE_ROC},
                {MinguoEra.ROC},
                {ThaiBuddhistEra.BEFORE_BE},
                {ThaiBuddhistEra.BE},
    };
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: TCKChronology.java
@Test
public void test_HijrahChronology_dateYearDay() {
    Chronology chrono = Chronology.of("Hijrah");
    ChronoLocalDate date1 = chrono.dateYearDay(HijrahEra.AH, 1434, 178);
    ChronoLocalDate date2 = chrono.date(HijrahEra.AH, 1434, 7, 1);
    assertEquals(date1, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
    assertEquals(date2, HijrahChronology.INSTANCE.dateYearDay(HijrahEra.AH, 1434, 178));
}
 
源代码26 项目: openjdk-8   文件: TCKHijrahChronology.java
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
    Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
    int i = 0;
    for (ResolverStyle style : ResolverStyle.values()) {
        for (HijrahEra era : HijrahEra.values()) {
            result[i++] = new Object[] {style, era};
        }
    }
    return result;
}
 
源代码27 项目: openjdk-jdk8u-backup   文件: TCKHijrahEra.java
@Test(dataProvider="HijrahEras")
public void test_valueOf(HijrahEra era , String eraName, int eraValue) {
    assertEquals(era.getValue(), eraValue);

    assertEquals(HijrahChronology.INSTANCE.eraOf(eraValue), era);
    assertEquals(HijrahEra.of(eraValue), era);
    assertEquals(HijrahEra.valueOf(eraName), era);
}
 
源代码28 项目: jdk8u_jdk   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraAndYearOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    fieldValues.put(ChronoField.YEAR, 1343L);
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.get(ChronoField.YEAR), (Long) 1343L);
    assertEquals(fieldValues.size(), 2);
}
 
源代码29 项目: openjdk-jdk8u-backup   文件: TCKHijrahChronology.java
@DataProvider(name = "resolve_styleByEra")
Object[][] data_resolve_styleByEra() {
    Object[][] result = new Object[ResolverStyle.values().length * HijrahEra.values().length][];
    int i = 0;
    for (ResolverStyle style : ResolverStyle.values()) {
        for (HijrahEra era : HijrahEra.values()) {
            result[i++] = new Object[] {style, era};
        }
    }
    return result;
}
 
源代码30 项目: openjdk-jdk8u-backup   文件: TCKHijrahChronology.java
@Test(dataProvider = "resolve_styleByEra")
public void test_resolve_yearOfEra_eraOnly_valid(ResolverStyle style, HijrahEra era) {
    Map<TemporalField, Long> fieldValues = new HashMap<>();
    fieldValues.put(ChronoField.ERA, (long) era.getValue());
    HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style);
    assertEquals(date, null);
    assertEquals(fieldValues.get(ChronoField.ERA), (Long) (long) era.getValue());
    assertEquals(fieldValues.size(), 1);
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法