@@ -471,7 +471,7 @@ public interface PublisherVerificationRules {
471
471
void required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops () throws Throwable ;
472
472
/**
473
473
* Asks for a short {@code Publisher} (length 10) and issues a {@code request(0)} which should trigger an {@code onError} call
474
- * with an {@code IllegalArgumentException} and the message containing the string "3.9" (reference to the rule number) .
474
+ * with an {@code IllegalArgumentException}.
475
475
* <p>
476
476
* <b>Verifies rule:</b> <a href='https://github.com/reactive-streams/reactive-streams-jvm#3.9'>3.9</a>
477
477
* <p>
@@ -495,8 +495,8 @@ public interface PublisherVerificationRules {
495
495
*/
496
496
void required_spec309_requestZeroMustSignalIllegalArgumentException () throws Throwable ;
497
497
/**
498
- * Asks for a short {@code Publisher} (length 10) and issues a random, negative {@code request()} call which should trigger an {@code onError} call
499
- * with an {@code IllegalArgumentException} and the message containing the string "3.9" (reference to the rule number).
498
+ * Asks for a short {@code Publisher} (length 10) and issues a random, negative {@code request()} call which should
499
+ * trigger an {@code onError} call with an {@code IllegalArgumentException}.
500
500
* <p>
501
501
* <b>Verifies rule:</b> <a href='https://github.com/reactive-streams/reactive-streams-jvm#3.9'>3.9</a>
502
502
* <p>
@@ -519,6 +519,31 @@ public interface PublisherVerificationRules {
519
519
* </ul>
520
520
*/
521
521
void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException () throws Throwable ;
522
+ /**
523
+ * Asks for a short {@code Publisher} (length 10) and issues a random, negative {@code request()} call which should
524
+ * trigger an {@code onError} call with an {@code IllegalArgumentException}.
525
+ * <p>
526
+ * <b>Verifies rule:</b> <a href='https://github.com/reactive-streams/reactive-streams-jvm#3.9'>3.9</a>
527
+ * <p>
528
+ * The test is not executed if {@link org.reactivestreams.tck.PublisherVerification#maxElementsFromPublisher()} is less than 10.
529
+ * <p>
530
+ * Note that this test expects the {@code IllegalArgumentException} being signalled through {@code onError}, not by
531
+ * throwing from {@code request()} (which is also forbidden) or signalling the error by any other means (i.e., through the
532
+ * {@code Thread.currentThread().getUncaughtExceptionHandler()} for example).
533
+ * <p>
534
+ * Note also that requesting and emission may happen concurrently and honoring this rule may require extra coordination within
535
+ * the {@code Publisher}.
536
+ * <p>
537
+ * If this test fails, the following could be checked within the {@code Publisher} implementation:
538
+ * <ul>
539
+ * <li>the {@code TestEnvironment} has large enough timeout specified in case the {@code Publisher} has some time-delay behavior,</li>
540
+ * <li>make sure the {@link #required_createPublisher1MustProduceAStreamOfExactly1Element()} and {@link #required_createPublisher3MustProduceAStreamOfExactly3Elements()} tests pass,</li>
541
+ * <li>the {@code Publisher} can emit an {@code onError} in this particular case, even if there was no prior and legal
542
+ * {@code request} call and even if the {@code Publisher} would like to emit items first before emitting an {@code onError}
543
+ * in general.
544
+ * </ul>
545
+ */
546
+ void optional_spec309_requestNegativeNumberMaySignalIllegalArgumentExceptionWithSpecificMessage () throws Throwable ;
522
547
/**
523
548
* Asks for a short {@code Publisher} (length 20), requests some items (less than the length), consumes one item then
524
549
* cancels the sequence and verifies the publisher emitted at most the requested amount and stopped emitting (or terminated).
0 commit comments