use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_plusHours_toMidday_equal.
@Test
public void test_plusHours_toMidday_equal() {
LocalTime t = LocalTime.of(11, 0).plusHours(1);
assertEquals(t, LocalTime.NOON);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method now_Clock_min.
@Test
public void now_Clock_min() {
Clock clock = Clock.fixed(Instant.MIN, ZoneOffset.UTC);
LocalTime test = LocalTime.now(clock);
assertEquals(test.getHour(), 0);
assertEquals(test.getMinute(), 0);
assertEquals(test.getSecond(), 0);
assertEquals(test.getNano(), 0);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_plusNanos_noChange_equal.
@Test
public void test_plusNanos_noChange_equal() {
LocalTime t = TEST_12_30_40_987654321.plusNanos(0);
assertEquals(t, TEST_12_30_40_987654321);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_with_longTemporalField_microOfSecond.
// Returns a {@code LocalTime} with the nano-of-second replaced by the specified
// micro-of-second multiplied by 1,000.
// The hour, minute and second will be unchanged.
@Test
public void test_with_longTemporalField_microOfSecond() {
for (long i : testPoints(1_000_000L)) {
LocalTime test = TEST_12_30_40_987654321.with(MICRO_OF_SECOND, i);
assertEquals(test.get(NANO_OF_SECOND), i * 1_000);
assertEquals(test.get(HOUR_OF_DAY), TEST_12_30_40_987654321.get(HOUR_OF_DAY));
assertEquals(test.get(MINUTE_OF_HOUR), TEST_12_30_40_987654321.get(MINUTE_OF_HOUR));
assertEquals(test.get(SECOND_OF_MINUTE), TEST_12_30_40_987654321.get(SECOND_OF_MINUTE));
}
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_withNanoOfSecond_noChange_equal.
@Test
public void test_withNanoOfSecond_noChange_equal() {
LocalTime t = TEST_12_30_40_987654321.withNano(987654321);
assertEquals(t, TEST_12_30_40_987654321);
}
Aggregations