use of java.time.LocalTime in project querydsl by querydsl.
the class JSR310LocalTimeTypeTest method jodaSet.
@Test
public void jodaSet() throws SQLException {
LocalTime value = LocalTime.now();
Time time = new Time(value.get(ChronoField.MILLI_OF_DAY));
PreparedStatement stmt = EasyMock.createNiceMock(PreparedStatement.class);
stmt.setTime(1, time, UTC);
EasyMock.replay(stmt);
new LocalTimeType().setValue(stmt, 1, toJoda(value));
EasyMock.verify(stmt);
}
use of java.time.LocalTime in project requery by requery.
the class TimeConversionsTest method testInsertReadLocalTime.
@Test
public void testInsertReadLocalTime() {
Event event = new Event();
UUID id = UUID.randomUUID();
LocalTime localTimeNow = LocalTime.now();
event.setId(id);
event.setLocalTime(localTimeNow);
data.insert(event);
event = data.findByKey(Event.class, id);
Assert.assertEquals(localTimeNow.withNano(0), event.getLocalTime());
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_comparisons_LocalDateTime.
void test_comparisons_LocalDateTime(LocalDate[] localDates, LocalTime... localTimes) {
LocalDateTime[] localDateTimes = new LocalDateTime[localDates.length * localTimes.length];
int i = 0;
for (LocalDate localDate : localDates) {
for (LocalTime localTime : localTimes) {
localDateTimes[i++] = LocalDateTime.of(localDate, localTime);
}
}
doTest_comparisons_LocalDateTime(localDateTimes);
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKLocalDateTime method test_minusMinutes_fromZero.
@Test
public void test_minusMinutes_fromZero() {
LocalDateTime base = TEST_2007_07_15_12_30_40_987654321.with(LocalTime.MIDNIGHT);
LocalDate d = base.toLocalDate().minusDays(1);
LocalTime t = LocalTime.of(22, 49);
for (int i = 70; i > -70; i--) {
LocalDateTime dt = base.minusMinutes(i);
t = t.plusMinutes(1);
if (t.equals(LocalTime.MIDNIGHT)) {
d = d.plusDays(1);
}
assertEquals(dt.toLocalDate(), d);
assertEquals(dt.toLocalTime(), t);
}
}
use of java.time.LocalTime in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method factory_LocalTimeZoneOffset.
//-----------------------------------------------------------------------
@Test
public void factory_LocalTimeZoneOffset() {
LocalTime localTime = LocalTime.of(11, 30, 10, 500);
OffsetTime test = OffsetTime.of(localTime, OFFSET_PONE);
check(test, 11, 30, 10, 500, OFFSET_PONE);
}
Aggregations