use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_atTime_int_int_minuteTooSmall.
@Test(expectedExceptions = DateTimeException.class)
public void test_atTime_int_int_minuteTooSmall() {
LocalDate t = LocalDate.of(2008, 6, 30);
t.atTime(11, -1);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_plusDays_negativeAcrossYear.
@Test
public void test_plusDays_negativeAcrossYear() {
LocalDate t = TEST_2007_07_15.plusDays(-196);
assertEquals(t, LocalDate.of(2006, 12, 31));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_getLong_TemporalField.
@Test
public void test_getLong_TemporalField() {
LocalDate test = LocalDate.of(2008, 6, 30);
assertEquals(test.getLong(YEAR), 2008);
assertEquals(test.getLong(MONTH_OF_YEAR), 6);
assertEquals(test.getLong(YEAR_OF_ERA), 2008);
assertEquals(test.getLong(ERA), 1);
assertEquals(test.getLong(PROLEPTIC_MONTH), 2008 * 12 + 6 - 1);
assertEquals(test.getLong(DAY_OF_MONTH), 30);
assertEquals(test.getLong(DAY_OF_WEEK), 1);
assertEquals(test.getLong(DAY_OF_YEAR), 182);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusDays_negative.
@Test
public void test_minusDays_negative() {
LocalDate t = TEST_2007_07_15.minusDays(-1);
assertEquals(t, LocalDate.of(2007, 7, 16));
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minusDays_negativeAcrossYear.
@Test
public void test_minusDays_negativeAcrossYear() {
LocalDate t = TEST_2007_07_15.minusDays(-169);
assertEquals(t, LocalDate.of(2007, 12, 31));
}
Aggregations