Search in sources :

Example 71 with OffsetTime

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

the class TCKOffsetTime method test_withOffsetSameLocal_noChange.

@Test
public void test_withOffsetSameLocal_noChange() {
    OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
    OffsetTime test = base.withOffsetSameLocal(OFFSET_PONE);
    assertEquals(test, base);
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.testng.annotations.Test)

Example 72 with OffsetTime

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

the class TCKOffsetTime method test_isBeforeIsAfterIsEqual2.

@Test
public void test_isBeforeIsAfterIsEqual2() {
    OffsetTime a = OffsetTime.of(11, 30, 59, 0, OFFSET_PTWO);
    // a is before b due to offset
    OffsetTime b = OffsetTime.of(11, 30, 58, 0, OFFSET_PONE);
    assertEquals(a.isBefore(b), true);
    assertEquals(a.isEqual(b), false);
    assertEquals(a.isAfter(b), false);
    assertEquals(b.isBefore(a), false);
    assertEquals(b.isEqual(a), false);
    assertEquals(b.isAfter(a), true);
    assertEquals(a.isBefore(a), false);
    assertEquals(b.isBefore(b), false);
    assertEquals(a.isEqual(a), true);
    assertEquals(b.isEqual(b), true);
    assertEquals(a.isAfter(a), false);
    assertEquals(b.isAfter(b), false);
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.testng.annotations.Test)

Example 73 with OffsetTime

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

the class TCKOffsetTime method test_minusNanos_zero.

@Test
public void test_minusNanos_zero() {
    OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
    OffsetTime test = base.minusNanos(0);
    assertEquals(test, base);
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.testng.annotations.Test)

Example 74 with OffsetTime

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

the class TCKOffsetTime method test_withNanoOfSecond_normal.

//-----------------------------------------------------------------------
// withNano()
//-----------------------------------------------------------------------
@Test
public void test_withNanoOfSecond_normal() {
    OffsetTime base = OffsetTime.of(11, 30, 59, 1, OFFSET_PONE);
    OffsetTime test = base.withNano(15);
    assertEquals(test, OffsetTime.of(11, 30, 59, 15, OFFSET_PONE));
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.testng.annotations.Test)

Example 75 with OffsetTime

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

the class TCKOffsetTime method test_withHour_noChange.

@Test
public void test_withHour_noChange() {
    OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
    OffsetTime test = base.withHour(11);
    assertEquals(test, base);
}
Also used : OffsetTime(java.time.OffsetTime) Test(org.testng.annotations.Test)

Aggregations

OffsetTime (java.time.OffsetTime)99 Test (org.testng.annotations.Test)86 ZonedDateTime (java.time.ZonedDateTime)9 LocalTime (java.time.LocalTime)8 Instant (java.time.Instant)7 OffsetDateTime (java.time.OffsetDateTime)7 Time (java.sql.Time)6 LocalDate (java.time.LocalDate)6 LocalDateTime (java.time.LocalDateTime)6 Test (org.junit.Test)6 Date (java.sql.Date)3 ResultSet (java.sql.ResultSet)3 Clock (java.time.Clock)3 PostgresUtils.toPGArrayString (org.jooq.util.postgres.PostgresUtils.toPGArrayString)3 BigDecimal (java.math.BigDecimal)2 PreparedStatement (java.sql.PreparedStatement)2 Timestamp (java.sql.Timestamp)2 Duration (java.time.Duration)2 Period (java.time.Period)2 ZoneId (java.time.ZoneId)2