use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_plus_Period.
//-----------------------------------------------------------------------
// plus(Period)
//-----------------------------------------------------------------------
@Test
public void test_plus_Period() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.MONTHS);
OffsetDateTime t = TEST_2008_6_30_11_30_59_000000500.plus(period);
assertEquals(t, OffsetDateTime.of(2009, 1, 30, 11, 30, 59, 500, OFFSET_PONE));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plus_Period_positiveMonths.
//-----------------------------------------------------------------------
// plus(Period)
//-----------------------------------------------------------------------
@Test
public void test_plus_Period_positiveMonths() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.MONTHS);
LocalDate t = TEST_2007_07_15.plus(period);
assertEquals(t, LocalDate.of(2008, 2, 15));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plus_Period_timeNotAllowed.
@Test(expectedExceptions = DateTimeException.class)
public void test_plus_Period_timeNotAllowed() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.HOURS);
TEST_2007_07_15.plus(period);
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plus_Period_negativeDays.
@Test
public void test_plus_Period_negativeDays() {
MockSimplePeriod period = MockSimplePeriod.of(-25, ChronoUnit.DAYS);
LocalDate t = TEST_2007_07_15.plus(period);
assertEquals(t, LocalDate.of(2007, 6, 20));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minus_Period_invalidTooLarge.
@Test(expectedExceptions = DateTimeException.class)
public void test_minus_Period_invalidTooLarge() {
MockSimplePeriod period = MockSimplePeriod.of(-1, ChronoUnit.YEARS);
LocalDate.of(Year.MAX_VALUE, 1, 1).minus(period);
}
Aggregations