use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusDays_overLeapYears.
@Test
public void test_plusDays_overLeapYears() {
LocalDate t = TEST_2007_07_15.plusYears(-1).plusDays(365 + 366);
assertEquals(t, LocalDate.of(2008, 7, 15));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusWeeks_overYears.
@Test
public void test_minusWeeks_overYears() {
LocalDate t = LocalDate.of(2008, 7, 13).minusWeeks(52);
assertEquals(t, TEST_2007_07_15);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusMonths_long_negative.
@Test
public void test_plusMonths_long_negative() {
LocalDate t = TEST_2007_07_15.plusMonths(-1);
assertEquals(t, LocalDate.of(2007, 6, 15));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusDays_negativeOverYears.
@Test
public void test_plusDays_negativeOverYears() {
LocalDate t = TEST_2007_07_15.plusDays(-730);
assertEquals(t, LocalDate.of(2005, 7, 15));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method factory_parse_formatter.
//-----------------------------------------------------------------------
// parse(DateTimeFormatter)
//-----------------------------------------------------------------------
@Test
public void factory_parse_formatter() {
DateTimeFormatter f = DateTimeFormatter.ofPattern("y M d");
LocalDate test = LocalDate.parse("2010 12 3", f);
assertEquals(test, LocalDate.of(2010, 12, 3));
}
Aggregations