use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TestChronoLocalDate method test_date_checkGenerics_chronoLocalDateTime2.
public void test_date_checkGenerics_chronoLocalDateTime2() {
LocalDateTime now = LocalDateTime.now();
Chronology chrono = ThaiBuddhistChronology.INSTANCE;
ChronoLocalDateTime<? extends ChronoLocalDate> ldt = chrono.localDateTime(now);
ldt = processCLDT(ldt);
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TestExampleCode method test_HijrahTypeViaLocale.
@Test(dataProvider = "HijrahTypeNames")
public void test_HijrahTypeViaLocale(String calendarId, String calendarType) {
Locale.Builder builder = new Locale.Builder();
builder.setLanguage("en").setRegion("US");
builder.setUnicodeLocaleKeyword("ca", calendarType);
Locale locale = builder.build();
Chronology chrono = Chronology.ofLocale(locale);
System.out.printf(" Locale language tag: %s, Chronology ID: %s, type: %s%n", locale.toLanguageTag(), chrono, chrono.getCalendarType());
Chronology expected = Chronology.of(calendarId);
assertEquals(chrono, expected, "Expected chronology not found");
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKCopticSerialization method test_eraSerialization.
@Test
public void test_eraSerialization() throws IOException, ClassNotFoundException {
Chronology chrono = Chronology.of("Coptic");
ChronoLocalDate copticDate = chrono.date(1729, 4, 27);
assertSerializable(copticDate);
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKThaiBuddhistChronology method test_chrono_byLocale_oldTH_noVariant.
@Test
public void test_chrono_byLocale_oldTH_noVariant() {
// deliberately different to Calendar
Chronology test = Chronology.ofLocale(new Locale("th", "TH"));
Assert.assertEquals(test.getId(), "ISO");
Assert.assertEquals(test, IsoChronology.INSTANCE);
}
use of java.time.chrono.Chronology in project jdk8u_jdk by JetBrains.
the class TCKThaiBuddhistChronology method test_chrono_byName.
//-----------------------------------------------------------------------
// Chronology.of(String)
//-----------------------------------------------------------------------
@Test
public void test_chrono_byName() {
Chronology c = ThaiBuddhistChronology.INSTANCE;
Chronology test = Chronology.of("ThaiBuddhist");
Assert.assertNotNull(test, "The ThaiBuddhist calendar could not be found byName");
Assert.assertEquals(test.getId(), "ThaiBuddhist", "ID mismatch");
Assert.assertEquals(test.getCalendarType(), "buddhist", "Type mismatch");
Assert.assertEquals(test, c);
}
Aggregations