use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_withMonth_tooHigh.
@Test(expectedExceptions = DateTimeException.class)
public void test_withMonth_tooHigh() {
YearMonth test = YearMonth.of(2008, 6);
test.withMonth(13);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusYears_long_invalidTooLargeMaxSubtractMax.
@Test(expectedExceptions = DateTimeException.class)
public void test_minusYears_long_invalidTooLargeMaxSubtractMax() {
YearMonth test = YearMonth.of(Year.MIN_VALUE, 12);
test.minusYears(Long.MAX_VALUE);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_plusMonths_long_big.
@Test
public void test_plusMonths_long_big() {
YearMonth test = YearMonth.of(-40, 6);
long months = 20L + Integer.MAX_VALUE;
assertEquals(test.plusMonths(months), YearMonth.of((int) (-40L + months / 12), 6 + (int) (months % 12)));
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_isValidDay_int_june.
//-----------------------------------------------------------------------
// isValidDay(int)
//-----------------------------------------------------------------------
@Test
public void test_isValidDay_int_june() {
YearMonth test = YearMonth.of(2007, 6);
assertEquals(test.isValidDay(1), true);
assertEquals(test.isValidDay(30), true);
assertEquals(test.isValidDay(-1), false);
assertEquals(test.isValidDay(0), false);
assertEquals(test.isValidDay(31), false);
assertEquals(test.isValidDay(32), false);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_withMonth_tooLow.
@Test(expectedExceptions = DateTimeException.class)
public void test_withMonth_tooLow() {
YearMonth test = YearMonth.of(2008, 6);
test.withMonth(0);
}
Aggregations