예제 #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!");
 }
예제 #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!");
 }