use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_with_Year_noChange_equal.
@Test
public void test_with_Year_noChange_equal() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.with(Year.of(2008)), test);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method now_ZoneId.
@Test
public void now_ZoneId() {
ZoneId zone = ZoneId.of("UTC+01:02:03");
YearMonth expected = YearMonth.now(Clock.system(zone));
YearMonth test = YearMonth.now(zone);
for (int i = 0; i < 100; i++) {
if (expected.equals(test)) {
return;
}
expected = YearMonth.now(Clock.system(zone));
test = YearMonth.now(zone);
}
assertEquals(test, expected);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method factory_intsMonth.
//-----------------------------------------------------------------------
@Test
public void factory_intsMonth() {
YearMonth test = YearMonth.of(2008, Month.FEBRUARY);
check(test, 2008, 2);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_until_invalidType.
@Test(expectedExceptions = DateTimeException.class)
public void test_until_invalidType() {
YearMonth start = YearMonth.of(2010, 6);
start.until(LocalTime.of(11, 30), MONTHS);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_withYear_tooLow.
@Test(expectedExceptions = DateTimeException.class)
public void test_withYear_tooLow() {
YearMonth test = YearMonth.of(2008, 6);
test.withYear(Year.MIN_VALUE - 1);
}
Aggregations