@@ -204,7 +204,6 @@ public void required_validate_boundedDepthOfOnNextAndRequestRecursion() throws E
204
204
205
205
////////////////////// SPEC RULE VERIFICATION ///////////////////////////////
206
206
207
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.1
208
207
@ Override @ Test
209
208
public void required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements () throws Throwable {
210
209
activePublisherTest (5 , false , new PublisherTestRun <T >() {
@@ -227,7 +226,6 @@ public void run(Publisher<T> pub) throws InterruptedException {
227
226
});
228
227
}
229
228
230
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.2
231
229
@ Override @ Test
232
230
public void required_spec102_maySignalLessThanRequestedAndTerminateSubscription () throws Throwable {
233
231
final int elements = 3 ;
@@ -244,7 +242,6 @@ public void run(Publisher<T> pub) throws Throwable {
244
242
});
245
243
}
246
244
247
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.3
248
245
@ Override @ Test
249
246
public void stochastic_spec103_mustSignalOnMethodsSequentially () throws Throwable {
250
247
final int iterations = 100 ;
@@ -353,7 +350,6 @@ public void onComplete() {
353
350
});
354
351
}
355
352
356
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.4
357
353
@ Override @ Test
358
354
public void optional_spec104_mustSignalOnErrorWhenFails () throws Throwable {
359
355
try {
@@ -391,7 +387,6 @@ public void onError(Throwable cause) {
391
387
}
392
388
}
393
389
394
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.5
395
390
@ Override @ Test
396
391
public void required_spec105_mustSignalOnCompleteWhenFiniteStreamTerminates () throws Throwable {
397
392
activePublisherTest (3 , true , new PublisherTestRun <T >() {
@@ -407,7 +402,6 @@ public void run(Publisher<T> pub) throws Throwable {
407
402
});
408
403
}
409
404
410
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.5
411
405
@ Override @ Test
412
406
public void optional_spec105_emptyStreamMustTerminateBySignallingOnComplete () throws Throwable {
413
407
optionalActivePublisherTest (0 , true , new PublisherTestRun <T >() {
@@ -421,13 +415,11 @@ public void run(Publisher<T> pub) throws Throwable {
421
415
});
422
416
}
423
417
424
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.6
425
418
@ Override @ Test
426
419
public void untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled () throws Throwable {
427
420
notVerified (); // not really testable without more control over the Publisher
428
421
}
429
422
430
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.7
431
423
@ Override @ Test
432
424
public void required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled () throws Throwable {
433
425
activePublisherTest (1 , true , new PublisherTestRun <T >() {
@@ -444,25 +436,21 @@ public void run(Publisher<T> pub) throws Throwable {
444
436
});
445
437
}
446
438
447
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.7
448
439
@ Override @ Test
449
440
public void untested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalled () throws Throwable {
450
441
notVerified (); // can we meaningfully test this, without more control over the publisher?
451
442
}
452
443
453
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.8
454
444
@ Override @ Test
455
445
public void untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals () throws Throwable {
456
446
notVerified (); // can we meaningfully test this?
457
447
}
458
448
459
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.9
460
449
@ Override @ Test
461
450
public void untested_spec109_subscribeShouldNotThrowNonFatalThrowable () throws Throwable {
462
451
notVerified (); // can we meaningfully test this?
463
452
}
464
453
465
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.9
466
454
@ Override @ Test
467
455
public void required_spec109_subscribeThrowNPEOnNullSubscriber () throws Throwable {
468
456
activePublisherTest (0 , false , new PublisherTestRun <T >() {
@@ -479,7 +467,6 @@ public void run(Publisher<T> pub) throws Throwable {
479
467
});
480
468
}
481
469
482
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.9
483
470
@ Override @ Test
484
471
public void required_spec109_mustIssueOnSubscribeForNonNullSubscriber () throws Throwable {
485
472
activePublisherTest (0 , false , new PublisherTestRun <T >() {
@@ -514,7 +501,6 @@ public void onComplete() {
514
501
});
515
502
}
516
503
517
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.9
518
504
@ Override @ Test
519
505
public void required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe () throws Throwable {
520
506
whenHasErrorPublisherTest (new PublisherTestRun <T >() {
@@ -545,7 +531,6 @@ public void onSubscribe(Subscription subs) {
545
531
});
546
532
}
547
533
548
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.10
549
534
@ Override @ Test
550
535
public void untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice () throws Throwable {
551
536
notVerified (); // can we meaningfully test this?
@@ -565,7 +550,6 @@ public void run(Publisher<T> pub) throws Throwable {
565
550
});
566
551
}
567
552
568
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.11
569
553
@ Override @ Test
570
554
public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne () throws Throwable {
571
555
optionalActivePublisherTest (5 , true , new PublisherTestRun <T >() { // This test is skipped if the publisher is unbounded (never sends onComplete)
@@ -616,7 +600,6 @@ public void run(Publisher<T> pub) throws InterruptedException {
616
600
});
617
601
}
618
602
619
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.11
620
603
@ Override @ Test
621
604
public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront () throws Throwable {
622
605
optionalActivePublisherTest (3 , false , new PublisherTestRun <T >() { // This test is skipped if the publisher cannot produce enough elements
@@ -649,7 +632,6 @@ public void run(Publisher<T> pub) throws Throwable {
649
632
});
650
633
}
651
634
652
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.11
653
635
@ Override @ Test
654
636
public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpected () throws Throwable {
655
637
optionalActivePublisherTest (3 , true , new PublisherTestRun <T >() { // This test is skipped if the publisher is unbounded (never sends onComplete)
@@ -685,7 +667,6 @@ public void run(Publisher<T> pub) throws Throwable {
685
667
686
668
///////////////////// SUBSCRIPTION TESTS //////////////////////////////////
687
669
688
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.2
689
670
@ Override @ Test
690
671
public void required_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribe () throws Throwable {
691
672
activePublisherTest (6 , false , new PublisherTestRun <T >() {
@@ -715,7 +696,6 @@ public void onNext(T element) {
715
696
});
716
697
}
717
698
718
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.3
719
699
@ Override @ Test
720
700
public void required_spec303_mustNotAllowUnboundedRecursion () throws Throwable {
721
701
final long oneMoreThanBoundedLimit = boundedDepthOfOnNextAndRequestRecursion () + 1 ;
@@ -798,19 +778,16 @@ public void onError(Throwable cause) {
798
778
});
799
779
}
800
780
801
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.4
802
781
@ Override @ Test
803
782
public void untested_spec304_requestShouldNotPerformHeavyComputations () throws Exception {
804
783
notVerified (); // cannot be meaningfully tested, or can it?
805
784
}
806
785
807
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.5
808
786
@ Override @ Test
809
787
public void untested_spec305_cancelMustNotSynchronouslyPerformHeavyCompuatation () throws Exception {
810
788
notVerified (); // cannot be meaningfully tested, or can it?
811
789
}
812
790
813
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.6
814
791
@ Override @ Test
815
792
public void required_spec306_afterSubscriptionIsCancelledRequestMustBeNops () throws Throwable {
816
793
activePublisherTest (3 , false , new PublisherTestRun <T >() {
@@ -844,7 +821,6 @@ public void cancel() {
844
821
});
845
822
}
846
823
847
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.7
848
824
@ Override @ Test
849
825
public void required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops () throws Throwable {
850
826
activePublisherTest (1 , false , new PublisherTestRun <T >() {
@@ -865,7 +841,6 @@ public void run(Publisher<T> pub) throws Throwable {
865
841
});
866
842
}
867
843
868
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.9
869
844
@ Override @ Test
870
845
public void required_spec309_requestZeroMustSignalIllegalArgumentException () throws Throwable {
871
846
activePublisherTest (10 , false , new PublisherTestRun <T >() {
@@ -877,7 +852,6 @@ public void required_spec309_requestZeroMustSignalIllegalArgumentException() thr
877
852
});
878
853
}
879
854
880
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.9
881
855
@ Override @ Test
882
856
public void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException () throws Throwable {
883
857
activePublisherTest (10 , false , new PublisherTestRun <T >() {
@@ -891,7 +865,6 @@ public void run(Publisher<T> pub) throws Throwable {
891
865
});
892
866
}
893
867
894
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.12
895
868
@ Override @ Test
896
869
public void required_spec312_cancelMustMakeThePublisherToEventuallyStopSignaling () throws Throwable {
897
870
// the publisher is able to signal more elements than the subscriber will be requesting in total
@@ -954,7 +927,6 @@ > AsyncPublisher receives cancel() - handles it right away, by "stopping itself"
954
927
env .verifyNoAsyncErrorsNoDelay ();
955
928
}
956
929
957
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.13
958
930
@ Override @ Test
959
931
public void required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber () throws Throwable {
960
932
final ReferenceQueue <ManualSubscriber <T >> queue = new ReferenceQueue <ManualSubscriber <T >>();
@@ -992,7 +964,6 @@ public void run(Publisher<T> pub) throws Throwable {
992
964
});
993
965
}
994
966
995
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.17
996
967
@ Override @ Test
997
968
public void required_spec317_mustSupportAPendingElementCountUpToLongMaxValue () throws Throwable {
998
969
final int totalElements = 3 ;
@@ -1011,7 +982,6 @@ public void run(Publisher<T> pub) throws Throwable {
1011
982
});
1012
983
}
1013
984
1014
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.17
1015
985
@ Override @ Test
1016
986
public void required_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValue () throws Throwable {
1017
987
final int totalElements = 3 ;
@@ -1037,7 +1007,6 @@ public void run(Publisher<T> pub) throws Throwable {
1037
1007
});
1038
1008
}
1039
1009
1040
- // Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.17
1041
1010
@ Override @ Test
1042
1011
public void required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue () throws Throwable {
1043
1012
activePublisherTest (Integer .MAX_VALUE , false , new PublisherTestRun <T >() {
0 commit comments