Search in sources :

Example 41 with LocalDateTime

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

the class TCKLocalDateTime method factory_of_5intsMonth.

//-----------------------------------------------------------------------
@Test
public void factory_of_5intsMonth() {
    LocalDateTime dateTime = LocalDateTime.of(2007, Month.JULY, 15, 12, 30, 40);
    check(dateTime, 2007, 7, 15, 12, 30, 40, 0);
}
Also used : LocalDateTime(java.time.LocalDateTime) Test(org.testng.annotations.Test)

Example 42 with LocalDateTime

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

the class TCKLocalDateTime method test_atZone.

//-----------------------------------------------------------------------
// atZone()
//-----------------------------------------------------------------------
@Test
public void test_atZone() {
    LocalDateTime t = LocalDateTime.of(2008, 6, 30, 11, 30);
    assertEquals(t.atZone(ZONE_PARIS), ZonedDateTime.of(LocalDateTime.of(2008, 6, 30, 11, 30), ZONE_PARIS));
}
Also used : LocalDateTime(java.time.LocalDateTime) Test(org.testng.annotations.Test)

Example 43 with LocalDateTime

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

the class TCKLocalDateTime method test_plusMonths_int_overYears.

@Test
public void test_plusMonths_int_overYears() {
    LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusMonths(25);
    check(t, 2009, 8, 15, 12, 30, 40, 987654321);
}
Also used : LocalDateTime(java.time.LocalDateTime) Test(org.testng.annotations.Test)

Example 44 with LocalDateTime

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

the class TCKLocalDateTime method test_plusDays_overMonths.

@Test
public void test_plusDays_overMonths() {
    LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.plusDays(62);
    check(t, 2007, 9, 15, 12, 30, 40, 987654321);
}
Also used : LocalDateTime(java.time.LocalDateTime) Test(org.testng.annotations.Test)

Example 45 with LocalDateTime

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

the class TCKLocalDateTime method test_minusWeeks_negative.

@Test
public void test_minusWeeks_negative() {
    LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minusWeeks(-1);
    check(t, 2007, 7, 22, 12, 30, 40, 987654321);
}
Also used : LocalDateTime(java.time.LocalDateTime) Test(org.testng.annotations.Test)

Aggregations

LocalDateTime (java.time.LocalDateTime)486 Test (org.testng.annotations.Test)282 Test (org.junit.Test)67 ZonedDateTime (java.time.ZonedDateTime)53 LocalDate (java.time.LocalDate)49 LocalTime (java.time.LocalTime)28 ZoneOffsetTransition (java.time.zone.ZoneOffsetTransition)26 Instant (java.time.Instant)21 DateTimeFormatter (java.time.format.DateTimeFormatter)20 List (java.util.List)18 Date (java.util.Date)17 ZoneId (java.time.ZoneId)16 ArrayList (java.util.ArrayList)14 AbstractTCKTest (tck.java.time.AbstractTCKTest)14 HashMap (java.util.HashMap)12 OffsetDateTime (java.time.OffsetDateTime)11 ZoneOffset (java.time.ZoneOffset)11 DateTimeParseException (java.time.format.DateTimeParseException)11 ZoneRules (java.time.zone.ZoneRules)10 IOException (java.io.IOException)9