/** * @param authorizedUser authorized user * @param authenticatedServer authenticated sasl server */ public AuthenticatedChannelInfo(String authorizedUser, SaslServer authenticatedServer) { mAuthorizedUser = authorizedUser; mAuthenticatedServer = authenticatedServer; mLastAccessTime = LocalTime.now(); }
private synchronized void updateLastAccessTime() { mLastAccessTime = LocalTime.now(); }
public static LocalTimeValue now( Clock clock ) { return new LocalTimeValue( LocalTime.now( clock ) ); }
private static String getJagexTime() { LocalTime time = LocalTime.now(JAGEX); return time.format(DATE_TIME_FORMAT); }
private static String getUTCTime() { LocalTime time = LocalTime.now(UTC); return time.format(DATE_TIME_FORMAT); }
void clearFocus() { LocalTime focusTime = timePicker.getValue(); if (focusTime == null) { focusTime = LocalTime.now(); } goToTime(focusTime); }
/** */ @Test public void testPassTableWithTimeKeyCreation() { final String creationQry = "CREATE TABLE %s (id TIME primary key, dateField TIME) " + "WITH \"cache_name=%s, WRAP_VALUE=false\""; Map<Time, Time> ent = new HashMap<>(); ent.put(Time.valueOf(LocalTime.now()), Time.valueOf(LocalTime.now().minusHours(1))); ent.put(Time.valueOf(LocalTime.now().minusHours(2)), Time.valueOf(LocalTime.now().minusHours(3))); checkInsertUpdateDelete(creationQry, "Tab2", ent); }
@Test public void shouldFailWhenLocalTimeIsSentWithRun() throws Exception { testFailureWithV2Value( ValueUtils.of( LocalTime.now() ), "LocalTime" ); }
@Test public void shouldReturnLocalDateTimeInstanceWhenConvertingLocalTimeToLocalDateTime() { LocalTime now = LocalTime.now(); assertThat(Conversions.toLocalDateTime(now)).isEqualTo(LocalDateTime.of(Conversions.EPOCH, now)); }
@Test public void shouldCallExternalErrorOnLocalTime() throws Exception { assumeThat( packerUnderTest.version(), equalTo( 1L ) ); testUnpackableStructParametersWithKnownType( new Neo4jPackV2(), ValueUtils.of( LocalTime.now() ), "LocalTime values cannot be unpacked with this version of bolt." ); }
@Test public void testConversion() throws ParseException { final LocalTime time = LocalTime.of(12, 30, 45); compare(LocalTime.class, LocalTime.now()); assertFormat(time, 45045000L); }
private static Stream<AnyValue> unsupportedValues() { return Stream.of( nodeValue( 42, stringArray( "Person" ), EMPTY_MAP ), newRelationshipValue(), pointValue( CoordinateReferenceSystem.WGS84, new double[2] ), byteArray( new byte[]{1, 2, 3} ), Values.of( Duration.ofHours( 1 ) ), Values.of( LocalDate.now() ), Values.of( LocalTime.now() ), Values.of( OffsetTime.now() ), Values.of( LocalDateTime.now() ), Values.of( ZonedDateTime.now() ) ); }
@SuppressWarnings("deprecation") @Test public void shouldReturnLocalDateTimeInstanceWhenConvertingSqlTimeToLocalDateTime() { LocalTime now = LocalTime.now(); java.sql.Time time = new java.sql.Time(now.getHour(),now.getMinute(),now.getSecond()); // 0 nanos! assertThat(Conversions.toLocalDateTime(time)).isEqualTo(LocalDateTime.of(Conversions.EPOCH, now.withNano(0))); }
@Test public void shouldReturnLocalTimeInstanceWhenConvertingLongToLocalTime() { LocalTime now = LocalTime.now(); long nanoOfDay = now.toNanoOfDay(); assertThat(Conversions.toLocalTime(nanoOfDay)).isEqualTo(now); } }
@Test public void testGetHour() { LocalTime now = LocalTime.now(); assertEquals(now.getHour(), getHour(pack(now))); }
@Test public void testGetMinute() { LocalTime now = LocalTime.now(); assertEquals(now.getMinute(), getMinute(pack(now))); }
@Test public void testGetSecond() { LocalTime now = LocalTime.now(); assertEquals(now.getSecond(), getSecond(pack(now))); }
@SuppressWarnings("deprecation") @Test public void shouldReturnLocalTimeInstanceWhenConvertingSqlTimeToLocalTime() { LocalTime now = LocalTime.now(); java.sql.Time time = new java.sql.Time(now.getHour(),now.getMinute(),now.getSecond()); // 0 nanos! assertThat(Conversions.toLocalTime(time)).isEqualTo(now.withNano(0)); }
@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()); }
@Test public void testPack() { LocalDate date = LocalDate.now(); LocalTime time = LocalTime.now(); long packed = pack(date, time); LocalDate d1 = PackedLocalDate.asLocalDate(date(packed)); LocalTime t1 = PackedLocalTime.asLocalTime(time(packed)); assertNotNull(d1); assertNotNull(t1); assertEquals(date.toString(), d1.toString()); }