コード例 #1
0
  @Test
  public void testNoTerminalEventBut1Error() {
    TestSubscriber<Integer> ts = TestSubscriber.create();

    ts.onError(new TestException());

    try {
      ts.assertNoTerminalEvent();
      fail("Failed to report there were terminal event(s)!");
    } catch (AssertionError ex) {
      // expected
    }
  }
コード例 #2
0
  @Test
  public void testNoTerminalEventBut2Errors() {
    TestSubscriber<Integer> ts = TestSubscriber.create();

    ts.onError(new TestException());
    ts.onError(new TestException());

    try {
      ts.assertNoTerminalEvent();
      fail("Failed to report there were terminal event(s)!");
    } catch (AssertionError ex) {
      // expected
      if (!(ex.getCause() instanceof CompositeException)) {
        fail("Did not report a composite exception cause: " + ex.getCause());
      }
    }
  }