File tree 1 file changed +28
-5
lines changed
rxjava-core/src/main/java/rx/observers
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) {
41
41
}
42
42
43
43
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
+ });
45
62
}
46
63
47
64
@ Override
48
65
public void onCompleted () {
49
- testObserver .onCompleted ();
50
- latch .countDown ();
66
+ try {
67
+ testObserver .onCompleted ();
68
+ } finally {
69
+ latch .countDown ();
70
+ }
51
71
}
52
72
53
73
public List <Notification <T >> getOnCompletedEvents () {
@@ -56,8 +76,11 @@ public List<Notification<T>> getOnCompletedEvents() {
56
76
57
77
@ Override
58
78
public void onError (Throwable e ) {
59
- testObserver .onError (e );
60
- latch .countDown ();
79
+ try {
80
+ testObserver .onError (e );
81
+ } finally {
82
+ latch .countDown ();
83
+ }
61
84
}
62
85
63
86
public List <Throwable > getOnErrorEvents () {
You can’t perform that action at this time.
0 commit comments