Search in sources :

Example 76 with LocalDate

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

Example 77 with LocalDate

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

Example 78 with LocalDate

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

Example 79 with LocalDate

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

Example 80 with LocalDate

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);
}
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