Esempio n. 1
0
 @Test
 public void testNoErrors() {
   TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
   ts.onError(new TestException());
   try {
     ts.assertNoErrors();
   } catch (AssertionError ex) {
     // expected
     return;
   }
   fail("Error present but no assertion error!");
 }
Esempio n. 2
0
 @Test
 public void testMultipleErrors() {
   TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
   ts.onError(new TestException());
   ts.onError(new TestException());
   try {
     ts.assertNoErrors();
   } catch (AssertionError ex) {
     if (!(ex.getCause() instanceof CompositeException)) {
       fail("Multiple Error present but the reported error doesn't have a composite cause!");
     }
     // expected
     return;
   }
   fail("Multiple Error present but no assertion error!");
 }