use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plus_Period_invalidTooLarge.
@Test(expectedExceptions = DateTimeException.class)
public void test_plus_Period_invalidTooLarge() {
MockSimplePeriod period = MockSimplePeriod.of(1, ChronoUnit.YEARS);
LocalDate.of(Year.MAX_VALUE, 1, 1).plus(period);
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minus_Period_timeNotAllowed.
@Test(expectedExceptions = DateTimeException.class)
public void test_minus_Period_timeNotAllowed() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.HOURS);
TEST_2007_07_15.minus(period);
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minus_Period_negativeDays.
@Test
public void test_minus_Period_negativeDays() {
MockSimplePeriod period = MockSimplePeriod.of(-25, ChronoUnit.DAYS);
LocalDate t = TEST_2007_07_15.minus(period);
assertEquals(t, LocalDate.of(2007, 8, 9));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minus_Period_positiveMonths.
//-----------------------------------------------------------------------
// minus(Period)
//-----------------------------------------------------------------------
@Test
public void test_minus_Period_positiveMonths() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.MONTHS);
LocalDate t = TEST_2007_07_15.minus(period);
assertEquals(t, LocalDate.of(2006, 12, 15));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plus_Period_invalidTooSmall.
@Test(expectedExceptions = DateTimeException.class)
public void test_plus_Period_invalidTooSmall() {
MockSimplePeriod period = MockSimplePeriod.of(-1, ChronoUnit.YEARS);
LocalDate.of(Year.MIN_VALUE, 1, 1).plus(period);
}
Aggregations