@Test public void testRunEventLogger() throws Exception { timerTask.run(); await() .atMost(Duration.ofSeconds(1)) .with() .pollInterval(Duration.ofMillis(100)) .until(mockEventHandler::getEventCount, greaterThanOrEqualTo(1)); assertEquals(1, mockEventHandler.getEventCount()); }
@Override public void run() { renameThread(); try { HeartbeatEvent heartbeat = EventFactory.create(heartbeatEventImp); heartbeat.setHeartbeatTime(System.currentTimeMillis()); heartbeat.extractState(adapter); heartbeat.logEvent(log); adapter.getEventHandler().send(heartbeat); } catch (Exception e) { log.trace("exception sending heartbeat Event; logging only", e); } }
HeartbeatTimerTask extends TimerTask { @Override public void run() { renameThread(); try { HeartbeatEvent heartbeat = EventFactory.create(heartbeatEventImp); heartbeat.setHeartbeatTime(System.currentTimeMillis()); heartbeat.extractState(adapter); heartbeat.logEvent(log); adapter.getEventHandler().send(heartbeat); } catch (Exception e) { log.trace("exception sending heartbeat Event; logging only", e); } } }
HeartbeatTimerTask extends TimerTask { @Override public void run() { renameThread(); try { HeartbeatEvent heartbeat = EventFactory.create(heartbeatEventImp); heartbeat.setHeartbeatTime(System.currentTimeMillis()); heartbeat.extractState(adapter); heartbeat.logEvent(log); adapter.getEventHandler().send(heartbeat); } catch (Exception e) { log.trace("exception sending heartbeat Event; logging only", e); } } HeartbeatTimerTask(Class<HeartbeatEvent> eventImpl, Adapter a); }
HeartbeatTimerTask extends TimerTask { @Override public void run() { renameThread(); try { HeartbeatEvent heartbeat = EventFactory.create(heartbeatEventImp); heartbeat.setHeartbeatTime(System.currentTimeMillis()); heartbeat.extractState(adapter); heartbeat.logEvent(log); adapter.getEventHandler().send(heartbeat); } catch (Exception e) { log.trace("exception sending heartbeat Event; logging only", e); } } HeartbeatTimerTask(Class<HeartbeatEvent> eventImpl, Adapter a); @Override void run(); }
HeartbeatTimerTask extends TimerTask { @Override public void run() { renameThread(); try { HeartbeatEvent heartbeat = EventFactory.create(heartbeatEventImp); heartbeat.setHeartbeatTime(System.currentTimeMillis()); heartbeat.extractState(adapter); heartbeat.logEvent(log); adapter.getEventHandler().send(heartbeat); } catch (Exception e) { log.trace("exception sending heartbeat Event; logging only", e); } } HeartbeatTimerTask(Class<HeartbeatEvent> eventImpl, Adapter a); @Override void run();  }