Search in sources :

Example 56 with ZonedDateTime

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

the class TCKZonedDateTime method test_minusNanos_nanos.

@Test
public void test_minusNanos_nanos() {
    LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 23, 30, 59, 0);
    ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
    ZonedDateTime test = base.minusNanos(1);
    assertEquals(test, ZonedDateTime.of(ldt.minusNanos(1), ZONE_0100));
}
Also used : LocalDateTime(java.time.LocalDateTime) ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 57 with ZonedDateTime

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

the class TCKZonedDateTime method test_withYear_normal.

//-----------------------------------------------------------------------
// withYear()
//-----------------------------------------------------------------------
@Test
public void test_withYear_normal() {
    ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100);
    ZonedDateTime test = base.withYear(2007);
    assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withYear(2007), ZONE_0100));
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 58 with ZonedDateTime

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

the class TCKZonedDateTime method test_with_adjuster_Offset_same.

@Test
public void test_with_adjuster_Offset_same() {
    ZonedDateTime base = ZonedDateTime.of(LocalDateTime.of(2012, 7, 31, 0, 0), ZONE_PARIS);
    ZonedDateTime test = base.with(ZoneOffset.ofHours(2));
    check(test, 2012, 7, 31, 0, 0, 0, 0, OFFSET_0200, ZONE_PARIS);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 59 with ZonedDateTime

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

the class TCKZonedDateTime method factory_ofInstant_allDaysInCycle.

@Test
public void factory_ofInstant_allDaysInCycle() {
    // sanity check using different algorithm
    ZonedDateTime expected = LocalDateTime.of(1970, 1, 1, 0, 0, 0, 0).atZone(ZoneOffset.UTC);
    for (long i = 0; i < 146097; i++) {
        Instant instant = Instant.ofEpochSecond(i * 24L * 60L * 60L);
        ZonedDateTime test = ZonedDateTime.ofInstant(instant, ZoneOffset.UTC);
        assertEquals(test, expected);
        expected = expected.plusDays(1);
    }
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Instant(java.time.Instant) Test(org.testng.annotations.Test)

Example 60 with ZonedDateTime

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

the class TCKZonedDateTime method test_minusSeconds_seconds.

@Test
public void test_minusSeconds_seconds() {
    LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 23, 30, 59, 0);
    ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
    ZonedDateTime test = base.minusSeconds(1);
    assertEquals(test, ZonedDateTime.of(ldt.minusSeconds(1), ZONE_0100));
}
Also used : LocalDateTime(java.time.LocalDateTime) ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Aggregations

ZonedDateTime (java.time.ZonedDateTime)1375 Test (org.junit.Test)570 Test (org.testng.annotations.Test)182 LocalDateTime (java.time.LocalDateTime)136 ZoneId (java.time.ZoneId)122 Instant (java.time.Instant)112 ArrayList (java.util.ArrayList)102 Test (org.junit.jupiter.api.Test)93 LocalDate (java.time.LocalDate)84 DateTimeFormatter (java.time.format.DateTimeFormatter)77 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)76 List (java.util.List)75 Date (java.util.Date)63 IOException (java.io.IOException)58 UUID (java.util.UUID)58 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)54 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)53 HashMap (java.util.HashMap)46 AbstractCoreWorkflowIntegrationTest (eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest)44 IdmConceptRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto)43