@Test public void testStart() { when(command.future()).thenReturn(new DefaultCommandFuture<>()); oneThreadTaskExecutor.executeCommand(command); sleep(50); verify(command).execute(); }
public void executeCommand(Command<?> command) { logger.debug("[executeCommand][offer it in pool]{}", command); boolean offer = false; synchronized (this) { offer = tasks.offer(command); } if (!offer) { throw new IllegalStateException("pool full:" + tasks.size()); } doExecute(); }
OneThreadTaskExecutor implements Destroyable { public void executeCommand(Command<?> command) { logger.debug("[executeCommand][offer it in pool]{}", command); boolean offer = false; synchronized (this) { offer = tasks.offer(command); } if (!offer) { throw new IllegalStateException("pool full:" + tasks.size()); } doExecute(); } }
OneThreadTaskExecutor implements Destroyable { public void executeCommand(Command<?> command) { logger.debug("[executeCommand][offer it in pool]{}", command); boolean offer = false; synchronized (this) { offer = tasks.offer(command); } if (!offer) { throw new IllegalStateException("pool full:" + tasks.size()); } doExecute(); } OneThreadTaskExecutor(Executor executors);  OneThreadTaskExecutor(RetryCommandFactory<?> retryCommandFactory, Executor executors); }
OneThreadTaskExecutor implements Destroyable { public void executeCommand(Command<?> command) { logger.debug("[executeCommand][offer it in pool]{}", command); boolean offer = false; synchronized (this) { offer = tasks.offer(command); } if (!offer) { throw new IllegalStateException("pool full:" + tasks.size()); } doExecute(); } OneThreadTaskExecutor(Executor executors);  OneThreadTaskExecutor(RetryCommandFactory<?> retryCommandFactory, Executor executors); void executeCommand(Command<?> command); @Override void destroy(); }
OneThreadTaskExecutor implements Destroyable { public void executeCommand(Command<?> command) { logger.debug("[executeCommand][offer it in pool]{}", command); boolean offer = false; synchronized (this) { offer = tasks.offer(command); } if (!offer) { throw new IllegalStateException("pool full:" + tasks.size()); } doExecute(); } OneThreadTaskExecutor(Executor executors);  OneThreadTaskExecutor(RetryCommandFactory<?> retryCommandFactory, Executor executors); void executeCommand(Command<?> command); @Override void destroy();  }