use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusMonths_long.
//-----------------------------------------------------------------------
// minusMonths()
//-----------------------------------------------------------------------
@Test
public void test_minusMonths_long() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.minusMonths(1), YearMonth.of(2008, 5));
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_isValidDay_int_febLeap.
@Test
public void test_isValidDay_int_febLeap() {
YearMonth test = YearMonth.of(2008, 2);
assertEquals(test.isValidDay(1), true);
assertEquals(test.isValidDay(29), true);
assertEquals(test.isValidDay(-1), false);
assertEquals(test.isValidDay(0), false);
assertEquals(test.isValidDay(30), false);
assertEquals(test.isValidDay(32), false);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_plusMonths_long_invalidTooLargeMaxAddMax.
@Test(expectedExceptions = DateTimeException.class)
public void test_plusMonths_long_invalidTooLargeMaxAddMax() {
YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
test.plusMonths(Long.MAX_VALUE);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_withYear_tooHigh.
@Test(expectedExceptions = DateTimeException.class)
public void test_withYear_tooHigh() {
YearMonth test = YearMonth.of(2008, 6);
test.withYear(Year.MAX_VALUE + 1);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_plusMonths_long_noChange_equal.
@Test
public void test_plusMonths_long_noChange_equal() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.plusMonths(0), test);
}
Aggregations