use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusMonths_long_negativeAcrossYear.
@Test
public void test_minusMonths_long_negativeAcrossYear() {
LocalDate t = TEST_2007_07_15.minusMonths(-7);
assertEquals(t, LocalDate.of(2008, 2, 15));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_withYear_int_normal.
//-----------------------------------------------------------------------
// withYear()
//-----------------------------------------------------------------------
@Test
public void test_withYear_int_normal() {
LocalDate t = TEST_2007_07_15.withYear(2008);
assertEquals(t, LocalDate.of(2008, 7, 15));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method setUp.
@BeforeMethod
public void setUp() {
TEST_2007_07_15 = LocalDate.of(2007, 7, 15);
LocalDate max = LocalDate.MAX;
LocalDate min = LocalDate.MIN;
MAX_VALID_EPOCHDAYS = max.toEpochDay();
MIN_VALID_EPOCHDAYS = min.toEpochDay();
MAX_DATE = max;
MIN_DATE = min;
MAX_INSTANT = max.atStartOfDay(ZoneOffset.UTC).toInstant();
MIN_INSTANT = min.atStartOfDay(ZoneOffset.UTC).toInstant();
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusDays_overYears.
@Test
public void test_plusDays_overYears() {
LocalDate t = LocalDate.of(2006, 7, 14).plusDays(366);
assertEquals(t, TEST_2007_07_15);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusWeeks_overYears.
@Test
public void test_plusWeeks_overYears() {
LocalDate t = LocalDate.of(2006, 7, 16).plusWeeks(52);
assertEquals(t, TEST_2007_07_15);
}
Aggregations