Search in sources :

Example 56 with LocalTime

use of java.time.LocalTime in project jdk8u_jdk by JetBrains.

the class TCKLocalTime method test_minusMinutes_noChange_equal.

@Test
public void test_minusMinutes_noChange_equal() {
    LocalTime t = TEST_12_30_40_987654321.minusMinutes(0);
    assertEquals(t, TEST_12_30_40_987654321);
}
Also used : LocalTime(java.time.LocalTime) Test(org.testng.annotations.Test)

Example 57 with LocalTime

use of java.time.LocalTime in project jdk8u_jdk by JetBrains.

the class TCKLocalTime method test_atDate.

//-----------------------------------------------------------------------
// atDate()
//-----------------------------------------------------------------------
@Test
public void test_atDate() {
    LocalTime t = LocalTime.of(11, 30);
    assertEquals(t.atDate(LocalDate.of(2012, 6, 30)), LocalDateTime.of(2012, 6, 30, 11, 30));
}
Also used : LocalTime(java.time.LocalTime) Test(org.testng.annotations.Test)

Example 58 with LocalTime

use of java.time.LocalTime in project jdk8u_jdk by JetBrains.

the class TCKLocalTime method test_minusSeconds_fromZero.

@Test(dataProvider = "minusSeconds_fromZero")
public void test_minusSeconds_fromZero(int seconds, int hour, int min, int sec) {
    LocalTime base = LocalTime.MIDNIGHT;
    LocalTime t = base.minusSeconds(seconds);
    assertEquals(t.getHour(), hour);
    assertEquals(t.getMinute(), min);
    assertEquals(t.getSecond(), sec);
}
Also used : LocalTime(java.time.LocalTime) Test(org.testng.annotations.Test)

Example 59 with LocalTime

use of java.time.LocalTime in project jdk8u_jdk by JetBrains.

the class TCKLocalTime method test_minus_TemporalAmount_zero.

@Test
public void test_minus_TemporalAmount_zero() {
    TemporalAmount period = Period.ZERO;
    LocalTime t = TEST_12_30_40_987654321.minus(period);
    assertEquals(t, TEST_12_30_40_987654321);
}
Also used : LocalTime(java.time.LocalTime) TemporalAmount(java.time.temporal.TemporalAmount) Test(org.testng.annotations.Test)

Example 60 with LocalTime

use of java.time.LocalTime in project jdk8u_jdk by JetBrains.

the class TCKLocalTime method test_minusHours_toMidday_equal.

@Test
public void test_minusHours_toMidday_equal() {
    LocalTime t = LocalTime.of(13, 0).minusHours(1);
    assertEquals(t, LocalTime.NOON);
}
Also used : LocalTime(java.time.LocalTime) Test(org.testng.annotations.Test)

Aggregations

LocalTime (java.time.LocalTime)676 Test (org.junit.Test)262 Test (org.testng.annotations.Test)173 LocalDate (java.time.LocalDate)156 LocalDateTime (java.time.LocalDateTime)130 ZonedDateTime (java.time.ZonedDateTime)36 Date (java.util.Date)32 Instant (java.time.Instant)30 OffsetDateTime (java.time.OffsetDateTime)30 DateTimeFormatter (java.time.format.DateTimeFormatter)27 Test (org.junit.jupiter.api.Test)27 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)23 ZoneOffset (java.time.ZoneOffset)23 ZoneId (java.time.ZoneId)22 ArrayList (java.util.ArrayList)19 BigDecimal (java.math.BigDecimal)18 TemporalAccessor (java.time.temporal.TemporalAccessor)18 TemporalAmount (java.time.temporal.TemporalAmount)18 Time (java.sql.Time)17 Clock (java.time.Clock)17