use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_plusMinutes_zero.
@Test
public void test_plusMinutes_zero() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.plusMinutes(0);
assertEquals(test, base);
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_minusSeconds_zero.
@Test
public void test_minusSeconds_zero() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.minusSeconds(0);
assertEquals(test, base);
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_compareTo_offset.
@Test
public void test_compareTo_offset() {
OffsetTime a = OffsetTime.of(11, 30, 0, 0, OFFSET_PTWO);
// a is before b due to offset
OffsetTime b = OffsetTime.of(11, 30, 0, 0, OFFSET_PONE);
assertEquals(a.compareTo(b) < 0, true);
assertEquals(b.compareTo(a) > 0, true);
assertEquals(a.compareTo(a) == 0, true);
assertEquals(b.compareTo(b) == 0, true);
assertEquals(convertInstant(a).compareTo(convertInstant(b)) < 0, true);
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_isBeforeIsAfterIsEqual2nanos.
@Test
public void test_isBeforeIsAfterIsEqual2nanos() {
OffsetTime a = OffsetTime.of(11, 30, 59, 4, ZoneOffset.ofTotalSeconds(OFFSET_PONE.getTotalSeconds() + 1));
// a is before b due to offset
OffsetTime b = OffsetTime.of(11, 30, 59, 3, 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);
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_until_convertedType.
@Test
public void test_until_convertedType() {
OffsetTime offsetTime = OffsetTime.of(1, 1, 1, 0, OFFSET_PONE);
OffsetDateTime offsetDateTime = offsetTime.plusSeconds(3).atDate(LocalDate.of(1980, 2, 10));
assertEquals(offsetTime.until(offsetDateTime, SECONDS), 3);
}
Aggregations