@Test public void testRunEvents() { invokeRunnablesOnce(); verifyNothingInvoked(); threadAccess.runEvents(); verifyAllInvokedoOnce(); Assert.assertEquals(0, threadAccess.getEventsCount()); }
public void runEvents() { checkThread(); while (!events.isEmpty()) { final Runnable event = events.poll(); if (event != null) { event.run(); } } }
EventBufferSingleThreadAccessMock implements ISingleThreadAccess { public void runEvents() { checkThread(); while (!events.isEmpty()) { final Runnable event = events.poll(); if (event != null) { event.run(); } } } }
EventBufferSingleThreadAccessMock implements ISingleThreadAccess { public void runEvents() { checkThread(); while (!events.isEmpty()) { final Runnable event = events.poll(); if (event != null) { event.run(); } } } EventBufferSingleThreadAccessMock(); }
EventBufferSingleThreadAccessMock implements ISingleThreadAccess { public void runEvents() { checkThread(); while (!events.isEmpty()) { final Runnable event = events.poll(); if (event != null) { event.run(); } } } EventBufferSingleThreadAccessMock(); @Override boolean isSingleThread(); @Override void invoke(final Runnable runnable); int getEventsCount(); List<Runnable> getEventsCopy(); List<Runnable> popEvents(); void runEvents(); void checkThread(); }
EventBufferSingleThreadAccessMock implements ISingleThreadAccess { public void runEvents() { checkThread(); while (!events.isEmpty()) { final Runnable event = events.poll(); if (event != null) { event.run(); } } } EventBufferSingleThreadAccessMock(); @Override boolean isSingleThread(); @Override void invoke(final Runnable runnable); int getEventsCount(); List<Runnable> getEventsCopy(); List<Runnable> popEvents(); void runEvents(); void checkThread();  }