Search in sources :

Example 61 with LocalDate

use of java.time.LocalDate in project jdk8u_jdk by JetBrains.

the class TestLocalDate method test_minus_longPeriodUnit_zero.

@Test
public void test_minus_longPeriodUnit_zero() {
    LocalDate t = TEST_2007_07_15.minus(0, ChronoUnit.DAYS);
    assertSame(t, TEST_2007_07_15);
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 62 with LocalDate

use of java.time.LocalDate in project jdk8u_jdk by JetBrains.

the class TestLocalDate method test_minusWeeks_symmetry.

@Test(dataProvider = "sampleMinusWeeksSymmetry")
public void test_minusWeeks_symmetry(LocalDate reference) {
    for (int weeks = 0; weeks < 365 * 8; weeks++) {
        LocalDate t = reference.minusWeeks(weeks).minusWeeks(-weeks);
        assertEquals(t, reference);
        t = reference.minusWeeks(-weeks).minusWeeks(weeks);
        assertEquals(t, reference);
    }
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 63 with LocalDate

use of java.time.LocalDate in project jdk8u_jdk by JetBrains.

the class TestLocalDate method test_plus_longPeriodUnit_zero.

@Test
public void test_plus_longPeriodUnit_zero() {
    LocalDate t = TEST_2007_07_15.plus(0, ChronoUnit.DAYS);
    assertSame(t, TEST_2007_07_15);
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 64 with LocalDate

use of java.time.LocalDate in project jdk8u_jdk by JetBrains.

the class TestLocalDate method test_minusDays_noChange_same.

@Test
public void test_minusDays_noChange_same() {
    LocalDate t = TEST_2007_07_15.minusDays(0);
    assertSame(t, TEST_2007_07_15);
}
Also used : LocalDate(java.time.LocalDate) Test(org.testng.annotations.Test)

Example 65 with LocalDate

use of java.time.LocalDate in project jdk8u_jdk by JetBrains.

the class TestLocalDate method test_plusDays_symmetry.

@Test(dataProvider = "samplePlusDaysSymmetry")
public void test_plusDays_symmetry(LocalDate reference) {
    for (int days = 0; days < 365 * 8; days++) {
        LocalDate t = reference.plusDays(days).plusDays(-days);
        assertEquals(t, reference);
        t = reference.plusDays(-days).plusDays(days);
        assertEquals(t, reference);
    }
}
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