@Override public ExecResponse get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException { try { return super.get(timeout, unit); } catch (TimeoutException e) { ScriptStillRunningException exception = new ScriptStillRunningException(timeout, unit, this); exception.initCause(e); throw exception; } }
public void simpleMessage() { ListenableFuture<ExecResponse> future = new AbstractFuture<ExecResponse>() { @Override public String toString() { return "task for foo"; } }; ScriptStillRunningException testMe = new ScriptStillRunningException(1000, TimeUnit.MILLISECONDS, future); assertEquals(testMe.getMessage(), "time up waiting 1s for task for foo to complete. call get() on this exception to get access to the task in progress"); } }
public void simpleMessage() { ListenableFuture<ExecResponse> future = new AbstractFuture<ExecResponse>() { @Override public String toString() { return "task for foo"; } }; ScriptStillRunningException testMe = new ScriptStillRunningException(1000, TimeUnit.MILLISECONDS, future); assertEquals(testMe.getMessage(), "time up waiting 1s for task for foo to complete. call get() on this exception to get access to the task in progress"); } }
@Override public ExecResponse get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException { try { return super.get(timeout, unit); } catch (TimeoutException e) { ScriptStillRunningException exception = new ScriptStillRunningException(timeout, unit, this); exception.initCause(e); throw exception; } }
@Override public ExecResponse get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException { try { return super.get(timeout, unit); } catch (TimeoutException e) { ScriptStillRunningException exception = new ScriptStillRunningException(timeout, unit, this); exception.initCause(e); throw exception; } }
@Override public ExecResponse get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException { try { return super.get(timeout, unit); } catch (TimeoutException e) { ScriptStillRunningException exception = new ScriptStillRunningException(timeout, unit, this); exception.initCause(e); throw exception; } }