/** * Merge the values in arbitrary order from a sequence of Solo sources. * @param <T> the common base value type * @param sources the sequence of sources * @return the new Flowable instance */ public static <T> Flowable<T> merge(Publisher<? extends Solo<? extends T>> sources) { return merge(sources, Integer.MAX_VALUE); }
/** * Merge the values in arbitrary order from a sequence of Solo sources. * @param <T> the common base value type * @param sources the sequence of sources * @return the new Flowable instance */ public static <T> Flowable<T> merge(Iterable<? extends Solo<? extends T>> sources) { return merge(sources, Integer.MAX_VALUE); }
/** * Merge the values in arbitrary order from a sequence of Solo sources. * @param <T> the common base value type * @param sources the sequence of sources * @return the new Flowable instance */ public static <T> Flowable<T> merge(Iterable<? extends Solo<? extends T>> sources) { return merge(sources, Integer.MAX_VALUE); }
/** * Merge the values in arbitrary order from a sequence of Solo sources. * @param <T> the common base value type * @param sources the sequence of sources * @return the new Flowable instance */ public static <T> Flowable<T> merge(Publisher<? extends Solo<? extends T>> sources) { return merge(sources, Integer.MAX_VALUE); }
@SuppressWarnings("unchecked") @Test public void mergeIterableError() { Solo.merge(Arrays.asList(Solo.just(1), Solo.error(new IOException()))) .test() .assertFailure(IOException.class, 1); }
@SuppressWarnings("unchecked") @Test public void mergeIterableError2() { Solo.merge(Arrays.asList(Solo.error(new IOException()), Solo.just(2))) .test() .assertFailure(IOException.class); }
@SuppressWarnings("unchecked") @Test public void mergeIterable() { Solo.merge(Arrays.asList(Solo.just(1), Solo.just(2))) .test() .assertResult(1, 2); }
@Test public void mergePublisherError() { Solo.merge(Flowable.just(Solo.just(1), Solo.error(new IOException()))) .test() .assertFailure(IOException.class, 1); }
@Test public void mergePublisherError2() { Solo.merge(Flowable.just(Solo.error(new IOException()), Solo.just(2))) .test() .assertFailure(IOException.class); }
@Test public void mergePublisherError3() { Solo.merge( Flowable.just(Solo.just(1)) .concatWith(Flowable.<Solo<Integer>>error(new IOException())) ) .test() .assertFailure(IOException.class, 1); }
@Test public void mergePublisherPrefetch() { Solo.merge(Flowable.just(Solo.just(1), Solo.just(2)), 1) .test() .assertResult(1, 2); }
@Test public void mergePublisher() { Solo.merge(Flowable.just(Solo.just(1), Solo.just(2))) .test() .assertResult(1, 2); }