Search in sources :

Example 21 with ZonedDateTime

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

the class TCKZonedDateTime method test_withMinute_normal.

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

Example 22 with ZonedDateTime

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

the class TCKZonedDateTime method test_withZoneSameInstant_null.

@Test(expectedExceptions = NullPointerException.class)
public void test_withZoneSameInstant_null() {
    ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100);
    base.withZoneSameInstant(null);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 23 with ZonedDateTime

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

the class TCKZonedDateTime method test_toString.

@Test(dataProvider = "sampleToString")
public void test_toString(int y, int o, int d, int h, int m, int s, int n, String zoneId, String expected) {
    ZonedDateTime t = ZonedDateTime.of(dateTime(y, o, d, h, m, s, n), ZoneId.of(zoneId));
    String str = t.toString();
    assertEquals(str, expected);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 24 with ZonedDateTime

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

the class TCKZonedDateTime method test_withZoneSameInstant_noChange.

@Test
public void test_withZoneSameInstant_noChange() {
    ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100);
    ZonedDateTime test = base.withZoneSameInstant(ZONE_0100);
    assertEquals(test, base);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Test(org.testng.annotations.Test)

Example 25 with ZonedDateTime

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

the class TCKZonedDateTime method test_with_adjuster_Year.

@Test
public void test_with_adjuster_Year() {
    LocalDateTime ldt = LocalDateTime.of(2008, 6, 30, 23, 30, 59, 0);
    ZonedDateTime base = ZonedDateTime.of(ldt, ZONE_0100);
    ZonedDateTime test = base.with(Year.of(2007));
    assertEquals(test, ZonedDateTime.of(ldt.withYear(2007), ZONE_0100));
}
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