use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_hashCode_second_differs.
@Test(dataProvider = "sampleTimes")
public void test_hashCode_second_differs(int h, int m, int s, int n) {
LocalTime a = LocalTime.of(h, m, s, n);
LocalTime b = LocalTime.of(h, m, s + 1, n);
assertEquals(a.hashCode() == b.hashCode(), false);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method factory_of_LocalDateLocalTimeZoneOffset.
//-----------------------------------------------------------------------
@Test
public void factory_of_LocalDateLocalTimeZoneOffset() {
LocalDate date = LocalDate.of(2008, 6, 30);
LocalTime time = LocalTime.of(11, 30, 10, 500);
OffsetDateTime test = OffsetDateTime.of(date, time, OFFSET_PONE);
check(test, 2008, 6, 30, 11, 30, 10, 500, OFFSET_PONE);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_plusHours_noChange_equal.
@Test
public void test_plusHours_noChange_equal() {
LocalTime t = TEST_12_30_40_987654321.plusHours(0);
assertEquals(t, TEST_12_30_40_987654321);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_toNanoOfDay_fromNanoOfDay_symmetry.
@Test
public void test_toNanoOfDay_fromNanoOfDay_symmetry() {
LocalTime t = LocalTime.of(0, 0);
for (int i = 0; i < 1000000; i++) {
assertEquals(LocalTime.ofNanoOfDay(t.toNanoOfDay()), t);
t = t.plusNanos(1);
}
t = LocalTime.of(0, 0);
for (int i = 1; i <= 1000000; i++) {
t = t.minusNanos(1);
assertEquals(LocalTime.ofNanoOfDay(t.toNanoOfDay()), t);
}
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_minusMinutes_big.
@Test
public void test_minusMinutes_big() {
LocalTime t = LocalTime.of(2, 30).minusMinutes(Long.MAX_VALUE);
int mins = (int) (Long.MAX_VALUE % (24L * 60L));
assertEquals(t, LocalTime.of(2, 30).minusMinutes(mins));
}
Aggregations