@Test(expected = WorkerspaceQueueException.class) public void whenDoubleStartThenOK() throws WorkerspaceQueueException { HandlerIO handlerIO = mock(HandlerIOImpl.class); WorkspaceBatchRunner workspaceBatchRunner = new WorkspaceBatchRunner(handlerIO, VitamThreadPoolExecutor.getDefaultExecutor(), 10); workspaceBatchRunner.start(); workspaceBatchRunner.start(); }
public void start() throws WorkerspaceQueueException { if (started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } started = true; this.executor.execute(this); }
WorkspaceBatchRunner implements Runnable { public void start() throws WorkerspaceQueueException { if (started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } started = true; this.executor.execute(this); } }
WorkspaceBatchRunner implements Runnable { public void start() throws WorkerspaceQueueException { if (started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } started = true; this.executor.execute(this); } WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize); }
WorkspaceBatchRunner implements Runnable { public void start() throws WorkerspaceQueueException { if (started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } started = true; this.executor.execute(this); } WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize); @Override void run(); void transfer(WorkspaceQueue workspaceQueue); void start(); void join(); }
WorkspaceBatchRunner implements Runnable { public void start() throws WorkerspaceQueueException { if (started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } started = true; this.executor.execute(this); } WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize); @Override void run(); void transfer(WorkspaceQueue workspaceQueue); void start(); void join();  }