@Test(expected = MockitoException.class) public void runTest() throws IOException { task.run(); }
@Override public void run() { try { LoggableEvent[] eventsToSave; synchronized (sendQueue) { eventsToSave = Iterables.toArray(sendQueue, LoggableEvent.class); } eventStore.save(eventsToSave); } catch (IOException ex) { Logger.getLogger(SavingTask.class.getName()).log(Level.WARNING, "Failed to save events", ex); } }
SavingTask implements Runnable { @Override public void run() { try { LoggableEvent[] eventsToSave; synchronized (sendQueue) { eventsToSave = Iterables.toArray(sendQueue, LoggableEvent.class); } eventStore.save(eventsToSave); } catch (IOException ex) { Logger.getLogger(SavingTask.class.getName()).log(Level.WARNING, "Failed to save events", ex); } } }
SavingTask implements Runnable { @Override public void run() { try { LoggableEvent[] eventsToSave; synchronized (sendQueue) { eventsToSave = Iterables.toArray(sendQueue, LoggableEvent.class); } eventStore.save(eventsToSave); } catch (IOException ex) { Logger.getLogger(SavingTask.class.getName()).log(Level.WARNING, "Failed to save events", ex); } } SavingTask(ArrayDeque<LoggableEvent> sendQueue, EventStore eventStore); }
SavingTask implements Runnable { @Override public void run() { try { LoggableEvent[] eventsToSave; synchronized (sendQueue) { eventsToSave = Iterables.toArray(sendQueue, LoggableEvent.class); } eventStore.save(eventsToSave); } catch (IOException ex) { Logger.getLogger(SavingTask.class.getName()).log(Level.WARNING, "Failed to save events", ex); } } SavingTask(ArrayDeque<LoggableEvent> sendQueue, EventStore eventStore); @Override void run(); }
SavingTask implements Runnable { @Override public void run() { try { LoggableEvent[] eventsToSave; synchronized (sendQueue) { eventsToSave = Iterables.toArray(sendQueue, LoggableEvent.class); } eventStore.save(eventsToSave); } catch (IOException ex) { Logger.getLogger(SavingTask.class.getName()).log(Level.WARNING, "Failed to save events", ex); } } SavingTask(ArrayDeque<LoggableEvent> sendQueue, EventStore eventStore); @Override void run();  }