@Test(expected = ExecutionException.class) public void toFutureError() throws Exception { Nono.error(new IOException()).toFuture().get(); }
@Test public void error() { Nono.error(new IOException()) .test() .assertFailure(IOException.class); }
@Test public void errorSupplierThrows() { Nono.error(new Callable<Throwable>() { @Override public Throwable call() throws Exception { throw new IOException(); } }) .test() .assertFailure(IOException.class); }
@Test public void errorSupplier() { Nono.error(new Callable<Throwable>() { @Override public Throwable call() throws Exception { return new IOException(); } }) .test() .assertFailure(IOException.class); }
@Test public void andThenNonoError() { Perhaps.just(1).andThen(Nono.error(new IOException())) .test() .assertFailure(IOException.class); }
@Test public void amb2Error() { Nono.amb(Arrays.asList(Nono.never(), Nono.error(new IOException()), Nono.never())) .test() .assertFailure(IOException.class); }
@Test public void concatIterableError() { Nono.concat(Arrays.asList(Nono.fromAction(this), Nono.error(new IOException()))) .test() .assertFailure(IOException.class); Assert.assertEquals(1, count); }
@Test public void amb1Error() { Nono.amb(Arrays.asList(Nono.error(new IOException()), Nono.never(), Nono.never())) .test() .assertFailure(IOException.class); }
@Test public void andThenNonoError() { Solo.just(1).andThen(Nono.error(new IOException())) .test() .assertFailure(IOException.class); }
@Test public void onErrorResumeNextError2() { ioError.onErrorResumeNext(Functions.justFunction(Nono.error(new IllegalArgumentException()))) .test() .assertFailure(IllegalArgumentException.class); }
@Test public void concatIterableDelayError() { Nono.concatDelayError( Arrays.asList(Nono.fromAction(this), Nono.error(new IOException()), Nono.fromAction(this))) .test() .assertFailure(IOException.class); Assert.assertEquals(2, count); }
@Test public void ambArray1Error() { Nono.ambArray(Nono.error(new IOException()), Nono.never(), Nono.never()) .test() .assertFailure(IOException.class); }
@Test public void concatArrayError() { Nono.concatArray(Nono.fromAction(this), Nono.error(new IOException())) .test() .assertFailure(IOException.class); Assert.assertEquals(1, count); }
@Test public void ambArray2Error() { Nono.ambArray(Nono.never(), Nono.error(new IOException()), Nono.never()) .test() .assertFailure(IOException.class); }
@Test public void concatArrayDelayError() { Nono.concatArrayDelayError( Nono.fromAction(this), Nono.error(new IOException()), Nono.fromAction(this)) .test() .assertFailure(IOException.class); Assert.assertEquals(2, count); }
@Test public void concatPublisherError() { Nono.concat(Flowable.fromArray(Nono.fromAction(this), Nono.error(new IOException()))) .test() .assertFailure(IOException.class); Assert.assertEquals(1, count); }
@Test public void concatPublisherDelayErrorMainBoundary() { Nono.concatDelayError( Flowable.fromArray(Nono.fromAction(this), Nono.error(new IOException()), Nono.fromAction(this)), 1, false) .test() .assertFailure(IOException.class); Assert.assertEquals(1, count); }
@Test public void concatPublisherDelayError() { Nono.concatDelayError( Flowable.fromArray(Nono.fromAction(this), Nono.error(new IOException()), Nono.fromAction(this))) .test() .assertFailure(IOException.class); Assert.assertEquals(2, count); }
@Test public void cacheError() { Nono np = Nono.error(new IOException()) .doOnSubscribe(this) .cache(); assertEquals(0, count); np.test().assertFailure(IOException.class); assertEquals(1, count); np.test().assertFailure(IOException.class); assertEquals(1, count); np.test().assertFailure(IOException.class); assertEquals(1, count); } }