File tree Expand file tree Collapse file tree 1 file changed +28
-5
lines changed
rxjava-core/src/main/java/rx/observers Expand file tree Collapse file tree 1 file changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,33 @@ public TestSubscriber(Observer<T> delegate) {
4141 }
4242
4343 public TestSubscriber () {
44- this .testObserver = new TestObserver <T >(Subscribers .<T > empty ());
44+ this .testObserver = new TestObserver <T >(new Observer <T >() {
45+
46+ @ Override
47+ public void onCompleted () {
48+ // do nothing
49+ }
50+
51+ @ Override
52+ public void onError (Throwable e ) {
53+ // do nothing
54+ }
55+
56+ @ Override
57+ public void onNext (T t ) {
58+ // do nothing
59+ }
60+
61+ });
4562 }
4663
4764 @ Override
4865 public void onCompleted () {
49- testObserver .onCompleted ();
50- latch .countDown ();
66+ try {
67+ testObserver .onCompleted ();
68+ } finally {
69+ latch .countDown ();
70+ }
5171 }
5272
5373 public List <Notification <T >> getOnCompletedEvents () {
@@ -56,8 +76,11 @@ public List<Notification<T>> getOnCompletedEvents() {
5676
5777 @ Override
5878 public void onError (Throwable e ) {
59- testObserver .onError (e );
60- latch .countDown ();
79+ try {
80+ testObserver .onError (e );
81+ } finally {
82+ latch .countDown ();
83+ }
6184 }
6285
6386 public List <Throwable > getOnErrorEvents () {
You can’t perform that action at this time.
0 commit comments