Search in sources :

Example 96 with LocalDate

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);
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 97 with LocalDate

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));
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 98 with LocalDate

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);
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 99 with LocalDate

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));
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 100 with LocalDate

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));
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Aggregations

LocalDate (java.time.LocalDate)1513 Test (org.junit.Test)472 Test (org.testng.annotations.Test)372 LocalDateTime (java.time.LocalDateTime)155 LocalTime (java.time.LocalTime)126 Date (java.util.Date)99 DateTimeFormatter (java.time.format.DateTimeFormatter)96 Ignore (org.junit.Ignore)94 ArrayList (java.util.ArrayList)87 BigDecimal (java.math.BigDecimal)69 Instant (java.time.Instant)56 ZonedDateTime (java.time.ZonedDateTime)55 Test (org.junit.jupiter.api.Test)54 List (java.util.List)50 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)46 HashMap (java.util.HashMap)44 Member (cz.metacentrum.perun.core.api.Member)41 ZoneId (java.time.ZoneId)40 TemporalField (java.time.temporal.TemporalField)40 Attribute (cz.metacentrum.perun.core.api.Attribute)39