@@ -2567,16 +2567,16 @@ public void call() {
2567
2567
public void subscribeTwoCallbacksNormal () {
2568
2568
final AtomicReference <Throwable > err = new AtomicReference <Throwable >();
2569
2569
final AtomicBoolean complete = new AtomicBoolean ();
2570
- normal .completable .subscribe (new Action1 <Throwable >() {
2571
- @ Override
2572
- public void call (Throwable e ) {
2573
- err .set (e );
2574
- }
2575
- }, new Action0 () {
2570
+ normal .completable .subscribe (new Action0 () {
2576
2571
@ Override
2577
2572
public void call () {
2578
2573
complete .set (true );
2579
2574
}
2575
+ }, new Action1 <Throwable >() {
2576
+ @ Override
2577
+ public void call (Throwable e ) {
2578
+ err .set (e );
2579
+ }
2580
2580
});
2581
2581
2582
2582
Assert .assertNull (err .get ());
@@ -2587,16 +2587,16 @@ public void call() {
2587
2587
public void subscribeTwoCallbacksError () {
2588
2588
final AtomicReference <Throwable > err = new AtomicReference <Throwable >();
2589
2589
final AtomicBoolean complete = new AtomicBoolean ();
2590
- error .completable .subscribe (new Action1 <Throwable >() {
2591
- @ Override
2592
- public void call (Throwable e ) {
2593
- err .set (e );
2594
- }
2595
- }, new Action0 () {
2590
+ error .completable .subscribe (new Action0 () {
2596
2591
@ Override
2597
2592
public void call () {
2598
2593
complete .set (true );
2599
2594
}
2595
+ }, new Action1 <Throwable >() {
2596
+ @ Override
2597
+ public void call (Throwable e ) {
2598
+ err .set (e );
2599
+ }
2600
2600
});
2601
2601
2602
2602
Assert .assertTrue (err .get () instanceof TestException );
@@ -2605,44 +2605,44 @@ public void call() {
2605
2605
2606
2606
@ Test (expected = NullPointerException .class )
2607
2607
public void subscribeTwoCallbacksFirstNull () {
2608
- normal .completable .subscribe (null , new Action0 () {
2608
+ normal .completable .subscribe (null , new Action1 < Throwable > () {
2609
2609
@ Override
2610
- public void call () { }
2610
+ public void call (Throwable throwable ) {}
2611
2611
});
2612
2612
}
2613
2613
2614
2614
@ Test (expected = NullPointerException .class )
2615
2615
public void subscribeTwoCallbacksSecondNull () {
2616
- normal .completable .subscribe (null , new Action0 () {
2616
+ normal .completable .subscribe (new Action0 () {
2617
2617
@ Override
2618
2618
public void call () { }
2619
- });
2619
+ }, null );
2620
2620
}
2621
2621
2622
2622
@ Test (timeout = 5000 )
2623
2623
public void subscribeTwoCallbacksCompleteThrows () {
2624
2624
final AtomicReference <Throwable > err = new AtomicReference <Throwable >();
2625
- normal .completable .subscribe (new Action1 <Throwable >() {
2625
+ normal .completable .subscribe (new Action0 () {
2626
+ @ Override
2627
+ public void call () { throw new TestException (); }
2628
+ }, new Action1 <Throwable >() {
2626
2629
@ Override
2627
2630
public void call (Throwable e ) {
2628
2631
err .set (e );
2629
2632
}
2630
- }, new Action0 () {
2631
- @ Override
2632
- public void call () { throw new TestException (); }
2633
2633
});
2634
2634
2635
2635
Assert .assertTrue (String .valueOf (err .get ()), err .get () instanceof TestException );
2636
2636
}
2637
2637
2638
2638
@ Test (timeout = 5000 )
2639
2639
public void subscribeTwoCallbacksOnErrorThrows () {
2640
- error .completable .subscribe (new Action1 <Throwable >() {
2641
- @ Override
2642
- public void call (Throwable e ) { throw new TestException (); }
2643
- }, new Action0 () {
2640
+ error .completable .subscribe (new Action0 () {
2644
2641
@ Override
2645
2642
public void call () { }
2643
+ }, new Action1 <Throwable >() {
2644
+ @ Override
2645
+ public void call (Throwable e ) { throw new TestException (); }
2646
2646
});
2647
2647
}
2648
2648
@@ -2800,14 +2800,14 @@ public void subscribeTwoActionsThrowFromOnError() {
2800
2800
expectUncaughtTestException (new Action0 () {
2801
2801
@ Override
2802
2802
public void call () {
2803
- error .completable .subscribe (new Action1 < Throwable > () {
2803
+ error .completable .subscribe (new Action0 () {
2804
2804
@ Override
2805
- public void call (Throwable throwable ) {
2806
- throw new TestException ();
2805
+ public void call () {
2807
2806
}
2808
- }, new Action0 () {
2807
+ }, new Action1 < Throwable > () {
2809
2808
@ Override
2810
- public void call () {
2809
+ public void call (Throwable throwable ) {
2810
+ throw new TestException ();
2811
2811
}
2812
2812
});
2813
2813
}
@@ -3132,14 +3132,14 @@ public void ambArrayOneFiresError() {
3132
3132
3133
3133
final AtomicReference <Throwable > complete = new AtomicReference <Throwable >();
3134
3134
3135
- c .subscribe (new Action1 <Throwable >() {
3135
+ c .subscribe (new Action0 () {
3136
+ @ Override
3137
+ public void call () { }
3138
+ }, new Action1 <Throwable >() {
3136
3139
@ Override
3137
3140
public void call (Throwable e ) {
3138
3141
complete .set (e );
3139
3142
}
3140
- }, new Action0 () {
3141
- @ Override
3142
- public void call () { }
3143
3143
});
3144
3144
3145
3145
Assert .assertTrue ("First subject no subscribers" , ps1 .hasObservers ());
@@ -3197,14 +3197,14 @@ public void ambArraySecondFiresError() {
3197
3197
3198
3198
final AtomicReference <Throwable > complete = new AtomicReference <Throwable >();
3199
3199
3200
- c .subscribe (new Action1 <Throwable >() {
3200
+ c .subscribe (new Action0 () {
3201
+ @ Override
3202
+ public void call () { }
3203
+ }, new Action1 <Throwable >() {
3201
3204
@ Override
3202
3205
public void call (Throwable e ) {
3203
3206
complete .set (e );
3204
3207
}
3205
- }, new Action0 () {
3206
- @ Override
3207
- public void call () { }
3208
3208
});
3209
3209
3210
3210
Assert .assertTrue ("First subject no subscribers" , ps1 .hasObservers ());
@@ -3363,14 +3363,14 @@ public void ambWithArrayOneFiresError() {
3363
3363
3364
3364
final AtomicReference <Throwable > complete = new AtomicReference <Throwable >();
3365
3365
3366
- c .subscribe (new Action1 <Throwable >() {
3366
+ c .subscribe (new Action0 () {
3367
+ @ Override
3368
+ public void call () { }
3369
+ }, new Action1 <Throwable >() {
3367
3370
@ Override
3368
3371
public void call (Throwable e ) {
3369
3372
complete .set (e );
3370
3373
}
3371
- }, new Action0 () {
3372
- @ Override
3373
- public void call () { }
3374
3374
});
3375
3375
3376
3376
Assert .assertTrue ("First subject no subscribers" , ps1 .hasObservers ());
@@ -3428,14 +3428,14 @@ public void ambWithArraySecondFiresError() {
3428
3428
3429
3429
final AtomicReference <Throwable > complete = new AtomicReference <Throwable >();
3430
3430
3431
- c .subscribe (new Action1 <Throwable >() {
3431
+ c .subscribe (new Action0 () {
3432
+ @ Override
3433
+ public void call () { }
3434
+ }, new Action1 <Throwable >() {
3432
3435
@ Override
3433
3436
public void call (Throwable e ) {
3434
3437
complete .set (e );
3435
3438
}
3436
- }, new Action0 () {
3437
- @ Override
3438
- public void call () { }
3439
3439
});
3440
3440
3441
3441
Assert .assertTrue ("First subject no subscribers" , ps1 .hasObservers ());
@@ -3841,14 +3841,14 @@ public void subscribeAction2ReportsUnsubscribedAfter() {
3841
3841
Completable completable = stringSubject .toCompletable ();
3842
3842
3843
3843
final AtomicReference <Subscription > subscriptionRef = new AtomicReference <Subscription >();
3844
- Subscription completableSubscription = completable .subscribe (Actions . empty (), new Action0 () {
3844
+ Subscription completableSubscription = completable .subscribe (new Action0 () {
3845
3845
@ Override
3846
3846
public void call () {
3847
3847
if (subscriptionRef .get ().isUnsubscribed ()) {
3848
3848
subscriptionRef .set (null );
3849
3849
}
3850
3850
}
3851
- });
3851
+ }, Actions . empty () );
3852
3852
subscriptionRef .set (completableSubscription );
3853
3853
3854
3854
stringSubject .onCompleted ();
@@ -3863,14 +3863,14 @@ public void subscribeAction2ReportsUnsubscribedOnErrorAfter() {
3863
3863
Completable completable = stringSubject .toCompletable ();
3864
3864
3865
3865
final AtomicReference <Subscription > subscriptionRef = new AtomicReference <Subscription >();
3866
- Subscription completableSubscription = completable .subscribe (new Action1 <Throwable >() {
3866
+ Subscription completableSubscription = completable .subscribe (Actions . empty (), new Action1 <Throwable >() {
3867
3867
@ Override
3868
3868
public void call (Throwable e ) {
3869
3869
if (subscriptionRef .get ().isUnsubscribed ()) {
3870
3870
subscriptionRef .set (null );
3871
3871
}
3872
3872
}
3873
- }, Actions . empty () );
3873
+ });
3874
3874
subscriptionRef .set (completableSubscription );
3875
3875
3876
3876
stringSubject .onError (new TestException ());
0 commit comments