use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method factory_ofInstant_beforeEpoch.
@Test
public void factory_ofInstant_beforeEpoch() {
for (int i = -1; i >= -(24 * 60 * 60); i--) {
Instant instant = Instant.ofEpochSecond(i, 8);
OffsetTime test = OffsetTime.ofInstant(instant, ZoneOffset.UTC);
assertEquals(test.getHour(), ((i + 24 * 60 * 60) / (60 * 60)) % 24);
assertEquals(test.getMinute(), ((i + 24 * 60 * 60) / 60) % 60);
assertEquals(test.getSecond(), (i + 24 * 60 * 60) % 60);
assertEquals(test.getNano(), 8);
}
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_plusSeconds.
//-----------------------------------------------------------------------
// plusSeconds()
//-----------------------------------------------------------------------
@Test
public void test_plusSeconds() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.plusSeconds(1);
assertEquals(test, OffsetTime.of(11, 31, 0, 0, OFFSET_PONE));
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_isEqual_null.
@Test(expectedExceptions = NullPointerException.class)
public void test_isEqual_null() {
OffsetTime a = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
a.isEqual(null);
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_minus_MinusAdjuster_zero.
@Test
public void test_minus_MinusAdjuster_zero() {
OffsetTime t = TEST_11_30_59_500_PONE.minus(Period.ZERO);
assertEquals(t, TEST_11_30_59_500_PONE);
}
use of java.time.OffsetTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_minusMinutes.
//-----------------------------------------------------------------------
// minusMinutes()
//-----------------------------------------------------------------------
@Test
public void test_minusMinutes() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.minusMinutes(50);
assertEquals(test, OffsetTime.of(10, 40, 59, 0, OFFSET_PONE));
}
Aggregations