/** * Fall back to another Solo if this Solo doesn't signal within the given * time period. * @param timeout the timeout value * @param unit the time unit * @param fallback the other Solo to subscribe to * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit, Solo<T> fallback) { return timeout(timer(timeout, unit), fallback); }
/** * Fall back to another Solo if this Solo doesn't signal within the given * time period, waiting on the specified scheduler. * @param timeout the timeout value * @param unit the time unit * @param scheduler the scheduler to wait on * @param fallback the fallback Solo to subscribe to * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler, Solo<T> fallback) { return timeout(timer(timeout, unit, scheduler), fallback); }
/** * Signal a TimeoutException if there is no item from this Solo within * the given timeout time. * @param timeout the timeout value * @param unit the time unit * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit) { return timeout(timer(timeout, unit)); }
/** * Signal a TimeoutException if there is no item from this Solo within * the given timeout time, running on the specified scheduler. * @param timeout the timeout value * @param unit the time unit * @param scheduler the scheduler to wait on * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout(timer(timeout, unit, scheduler)); }
/** * Fall back to another Solo if this Solo doesn't signal within the given * time period, waiting on the specified scheduler. * @param timeout the timeout value * @param unit the time unit * @param scheduler the scheduler to wait on * @param fallback the fallback Solo to subscribe to * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler, Solo<T> fallback) { return timeout(timer(timeout, unit, scheduler), fallback); }
/** * Signal a TimeoutException if there is no item from this Solo within * the given timeout time. * @param timeout the timeout value * @param unit the time unit * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit) { return timeout(timer(timeout, unit)); }
/** * Signal a TimeoutException if there is no item from this Solo within * the given timeout time, running on the specified scheduler. * @param timeout the timeout value * @param unit the time unit * @param scheduler the scheduler to wait on * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit, Scheduler scheduler) { return timeout(timer(timeout, unit, scheduler)); }
/** * Fall back to another Solo if this Solo doesn't signal within the given * time period. * @param timeout the timeout value * @param unit the time unit * @param fallback the other Solo to subscribe to * @return the new Solo instance */ public final Solo<T> timeout(long timeout, TimeUnit unit, Solo<T> fallback) { return timeout(timer(timeout, unit), fallback); }
@Test public void timeoutError() { Solo.error(new IOException()).timeout(1, TimeUnit.MINUTES) .test() .assertFailure(IOException.class); }
@Test public void timeoutNormal() { Solo.just(1).timeout(1, TimeUnit.MINUTES) .test() .assertResult(1); }