use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_plus_longTemporalUnit_positiveHours.
//-----------------------------------------------------------------------
// plus(long,TemporalUnit)
//-----------------------------------------------------------------------
@Test
public void test_plus_longTemporalUnit_positiveHours() {
LocalTime t = TEST_12_30_40_987654321.plus(7, ChronoUnit.HOURS);
assertEquals(t, LocalTime.of(19, 30, 40, 987654321));
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method factory_parse_validText.
//-----------------------------------------------------------------------
// parse()
//-----------------------------------------------------------------------
@Test(dataProvider = "sampleToString")
public void factory_parse_validText(int h, int m, int s, int n, String parsable) {
LocalTime t = LocalTime.parse(parsable);
assertNotNull(t, parsable);
assertEquals(t.getHour(), h);
assertEquals(t.getMinute(), m);
assertEquals(t.getSecond(), s);
assertEquals(t.getNano(), n);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_plusSeconds_noChange_oneDay_equal.
@Test
public void test_plusSeconds_noChange_oneDay_equal() {
LocalTime t = TEST_12_30_40_987654321.plusSeconds(24 * 60 * 60);
assertEquals(t, TEST_12_30_40_987654321);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_minus_longTemporalUnit_positiveHours.
//-----------------------------------------------------------------------
// minus(long,TemporalUnit)
//-----------------------------------------------------------------------
@Test
public void test_minus_longTemporalUnit_positiveHours() {
LocalTime t = TEST_12_30_40_987654321.minus(7, ChronoUnit.HOURS);
assertEquals(t, LocalTime.of(5, 30, 40, 987654321));
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalTime method test_minusNanos_toMidday_equal.
@Test
public void test_minusNanos_toMidday_equal() {
LocalTime t = LocalTime.of(12, 0, 0, 1).minusNanos(1);
assertEquals(t, LocalTime.NOON);
}
Aggregations