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);
}
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);
}
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);
}
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));
}
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);
}
Aggregations