Search in sources :

Example 26 with ZonedDateTime

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

the class TCKZonedDateTime method test_withDayOfYear_noChange.

@Test
public void test_withDayOfYear_noChange() {
    LocalDateTime ldt = LocalDateTime.of(2008, 2, 5, 23, 30, 59, 0);
    ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
    ZonedDateTime test = base.withDayOfYear(36);
    assertEquals(test, base);
}
Also used : LocalDateTime(java.time.LocalDateTime) ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 27 with ZonedDateTime

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

the class TCKZonedDateTime method test_equals_false_offset_differs.

@Test(dataProvider = "sampleTimes")
public void test_equals_false_offset_differs(int y, int o, int d, int h, int m, int s, int n, ZoneId ignored) {
    ZonedDateTime a = ZonedDateTime.of(dateTime(y, o, d, h, m, s, n), ZONE_0100);
    ZonedDateTime b = ZonedDateTime.of(dateTime(y, o, d, h, m, s, n), ZONE_0200);
    assertEquals(a.equals(b), false);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 28 with ZonedDateTime

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

the class TCKZonedDateTime method test_compareTo_offset1.

@Test
public void test_compareTo_offset1() {
    ZonedDateTime a = ZonedDateTime.of(2008, 6, 30, 11, 30, 41, 0, ZONE_0200);
    // a is before b due to offset
    ZonedDateTime b = ZonedDateTime.of(2008, 6, 30, 11, 30, 39, 0, ZONE_0100);
    assertEquals(a.compareTo(b) < 0, true);
    assertEquals(b.compareTo(a) > 0, true);
    assertEquals(a.compareTo(a) == 0, true);
    assertEquals(b.compareTo(b) == 0, true);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 29 with ZonedDateTime

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

the class TCKZonedDateTime method test_minusWeeks.

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

Example 30 with ZonedDateTime

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

the class TCKZonedDateTime method factory_ofStrict_LDT_ZI_ZO.

//-----------------------------------------------------------------------
// ofStrict(LocalDateTime, ZoneId, ZoneOffset)
//-----------------------------------------------------------------------
@Test
public void factory_ofStrict_LDT_ZI_ZO() {
    LocalDateTime normal = LocalDateTime.of(2008, 6, 30, 11, 30, 10, 500);
    ZonedDateTime test = ZonedDateTime.ofStrict(normal, OFFSET_0200, ZONE_PARIS);
    check(test, 2008, 6, 30, 11, 30, 10, 500, OFFSET_0200, ZONE_PARIS);
}
Also used : LocalDateTime(java.time.LocalDateTime) ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Aggregations

ZonedDateTime (java.time.ZonedDateTime)1461 Test (org.junit.Test)622 Test (org.testng.annotations.Test)182 LocalDateTime (java.time.LocalDateTime)145 ZoneId (java.time.ZoneId)129 Instant (java.time.Instant)114 ArrayList (java.util.ArrayList)104 Test (org.junit.jupiter.api.Test)96 LocalDate (java.time.LocalDate)90 List (java.util.List)80 DateTimeFormatter (java.time.format.DateTimeFormatter)78 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)76 Date (java.util.Date)66 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)47 AbstractCoreWorkflowIntegrationTest (eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest)44 OffsetDateTime (java.time.OffsetDateTime)44