@Test public void testCollectorFailureDoesNotResultInTwoErrorEmissionsFlowable() { try { final List<Throwable> list = new CopyOnWriteArrayList<Throwable>(); RxJavaCommonPlugins.setErrorHandler(addToList(list)); final RuntimeException e1 = new RuntimeException(); final RuntimeException e2 = new RuntimeException(); Burst.items(1).error(e2) // .collect(callableListCreator(), biConsumerThrows(e1)) .test() // .assertError(e1) // .assertNotComplete(); assertEquals(1, list.size()); assertEquals(e2, list.get(0).getCause()); } finally { RxJavaCommonPlugins.reset(); } }
@Test public void testCollectorFailureDoesNotResultInTwoErrorEmissions() { try { final List<Throwable> list = new CopyOnWriteArrayList<Throwable>(); RxJavaCommonPlugins.setErrorHandler(addToList(list)); final RuntimeException e1 = new RuntimeException(); final RuntimeException e2 = new RuntimeException(); Burst.items(1).error(e2) // .collect(callableListCreator(), biConsumerThrows(e1)) // .test() // .assertError(e1) // .assertNotComplete(); assertEquals(1, list.size()); assertEquals(e2, list.get(0).getCause()); } finally { RxJavaCommonPlugins.reset(); } }
@Test public void testCollectorFailureDoesNotResultInTwoErrorEmissions() { try { final List<Throwable> list = new CopyOnWriteArrayList<Throwable>(); RxJavaCommonPlugins.setErrorHandler(addToList(list)); final RuntimeException e1 = new RuntimeException(); final RuntimeException e2 = new RuntimeException(); Burst.items(1).error(e2) // .collect(callableListCreator(), biConsumerThrows(e1)) // .test() // .assertError(e1) // .assertNotComplete(); assertEquals(1, list.size()); assertEquals(e2, list.get(0).getCause()); } finally { RxJavaCommonPlugins.reset(); } }
@Test public void testCollectorFailureDoesNotResultInTwoErrorEmissionsObservable() { try { final List<Throwable> list = new CopyOnWriteArrayList<Throwable>(); RxJavaCommonPlugins.setErrorHandler(addToList(list)); final RuntimeException e1 = new RuntimeException(); final RuntimeException e2 = new RuntimeException(); Burst.items(1).error(e2) // .collect(callableListCreator(), biConsumerThrows(e1)) // .toObservable() .test() // .assertError(e1) // .assertNotComplete(); assertEquals(1, list.size()); assertEquals(e2, list.get(0).getCause()); } finally { RxJavaCommonPlugins.reset(); } }