()
| 1414 | } |
| 1415 | |
| 1416 | @Test |
| 1417 | public void basic() { |
| 1418 | List<Throwable> errors = TestHelper.trackPluginErrors(); |
| 1419 | try { |
| 1420 | final Disposable d = Disposable.empty(); |
| 1421 | |
| 1422 | Maybe.<Integer>create(new MaybeOnSubscribe<Integer>() { |
| 1423 | @Override |
| 1424 | public void subscribe(MaybeEmitter<Integer> e) throws Exception { |
| 1425 | e.setDisposable(d); |
| 1426 | |
| 1427 | e.onSuccess(1); |
| 1428 | e.onError(new TestException()); |
| 1429 | e.onSuccess(2); |
| 1430 | e.onError(new TestException()); |
| 1431 | e.onComplete(); |
| 1432 | } |
| 1433 | }) |
| 1434 | .test() |
| 1435 | .assertResult(1); |
| 1436 | |
| 1437 | assertTrue(d.isDisposed()); |
| 1438 | |
| 1439 | TestHelper.assertUndeliverable(errors, 0, TestException.class); |
| 1440 | TestHelper.assertUndeliverable(errors, 1, TestException.class); |
| 1441 | } finally { |
| 1442 | RxJavaPlugins.reset(); |
| 1443 | } |
| 1444 | } |
| 1445 | |
| 1446 | @Test |
| 1447 | public void basicWithError() { |
nothing calls this directly
no test coverage detected