/** * Cause the current thread to wait until this completion completes and succeeds with a configurable timeout.<p/> * * If completion times out or the current thread is interrupted or the suite fails, an exception will be thrown. * @param timeoutMillis the timeout in milliseconds */ public void awaitSuccess(long timeoutMillis) { delegate.awaitSuccess(timeoutMillis); }
/** * Cause the current thread to wait until this completion completes and succeeds.<p/> * * If the current thread is interrupted or the suite fails, an exception will be thrown. */ public void awaitSuccess() { delegate.awaitSuccess(); }
/** * Cause the current thread to wait until this completion completes and succeeds with a configurable timeout.<p/> * * If completion times out or the current thread is interrupted or the suite fails, an exception will be thrown. * @param timeoutMillis the timeout in milliseconds */ public void awaitSuccess(long timeoutMillis) { delegate.awaitSuccess(timeoutMillis); }
/** * Cause the current thread to wait until this completion completes and succeeds.<p/> * * If the current thread is interrupted or the suite fails, an exception will be thrown. */ public void awaitSuccess() { delegate.awaitSuccess(); }
@Test public void testAwaitSuccessSucceeded() { testSucceeded(completion -> completion.awaitSuccess()); testSucceeded(completion -> completion.awaitSuccess(2000)); }
@Test public void testAwaitSuccessFailed() throws Exception { testAwaitSuccessFailed(completion -> completion.awaitSuccess()); testAwaitSuccessFailed(completion -> completion.awaitSuccess(2000)); }
@Test public void testAwaitSuccessInterruption() { testAwaitSuccess(completion -> completion.awaitSuccess(), Thread.State.WAITING); testAwaitSuccess(completion -> completion.awaitSuccess(2000), Thread.State.TIMED_WAITING); }
@Test public void testAwaitSuccessTimeout() { testTimeout(completion -> completion.awaitSuccess(10)); }