File tree 1 file changed +4
-12
lines changed
rxjava-core/src/test/java/rx/operators
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -264,29 +264,21 @@ public Integer call(Integer arg0) {
264
264
}).toBlockingObservable ().single ();
265
265
}
266
266
267
- @ Test
267
+ @ Test ( expected = IllegalArgumentException . class )
268
268
public void testMapWithErrorInFuncAndThreadPoolScheduler () throws InterruptedException {
269
269
// The error will throw in one of threads in the thread pool.
270
270
// If map does not handle it, the error will disappear.
271
271
// so map needs to handle the error by itself.
272
- final CountDownLatch latch = new CountDownLatch (1 );
273
272
Observable <String > m = Observable .from ("one" )
274
273
.observeOn (Schedulers .threadPoolForComputation ())
275
274
.map (new Func1 <String , String >() {
276
275
public String call (String arg0 ) {
277
- try {
278
- throw new IllegalArgumentException ("any error" );
279
- } finally {
280
- latch .countDown ();
281
- }
276
+ throw new IllegalArgumentException ("any error" );
282
277
}
283
278
});
284
279
285
- m .subscribe (stringObserver );
286
- latch .await ();
287
- InOrder inorder = inOrder (stringObserver );
288
- inorder .verify (stringObserver , times (1 )).onError (any (IllegalArgumentException .class ));
289
- inorder .verifyNoMoreInteractions ();
280
+ // block for response, expecting exception thrown
281
+ m .toBlockingObservable ().last ();
290
282
}
291
283
292
284
/**
You can’t perform that action at this time.
0 commit comments