@Test void shouldNotBeOnEventThreadWhenStartedButNotUsingExecute() { eventThread.start(); assertThatThrownBy(eventThread::checkOnEventThread).isInstanceOf(IllegalStateException.class); }
@Override public synchronized void start() { if (started.get()) { return; } thread = asyncRunnerFactory.create(name, 1); started.set(true); }
AsyncRunnerEventThread implements EventThread { @Override public synchronized void start() { if (started.get()) { return; } thread = asyncRunnerFactory.create(name, 1); started.set(true); } }
AsyncRunnerEventThread implements EventThread { @Override public synchronized void start() { if (started.get()) { return; } thread = asyncRunnerFactory.create(name, 1); started.set(true); } AsyncRunnerEventThread(final String name, final AsyncRunnerFactory asyncRunnerFactory); }
AsyncRunnerEventThread implements EventThread { @Override public synchronized void start() { if (started.get()) { return; } thread = asyncRunnerFactory.create(name, 1); started.set(true); } AsyncRunnerEventThread(final String name, final AsyncRunnerFactory asyncRunnerFactory); @Override void checkOnEventThread(); @Override synchronized void start(); @Override synchronized void stop(); @Override void executeLater(final Runnable task); @Override void execute(final Runnable task); }
AsyncRunnerEventThread implements EventThread { @Override public synchronized void start() { if (started.get()) { return; } thread = asyncRunnerFactory.create(name, 1); started.set(true); } AsyncRunnerEventThread(final String name, final AsyncRunnerFactory asyncRunnerFactory); @Override void checkOnEventThread(); @Override synchronized void start(); @Override synchronized void stop(); @Override void executeLater(final Runnable task); @Override void execute(final Runnable task);  }