Skip to content

Commit 9b463ab

Browse files
authored
Merge pull request #362 from akarnokd/SubscriberTestExplanations
SubscriberBlackboxVerificationRules explained
2 parents 1330470 + 6f898f9 commit 9b463ab

File tree

2 files changed

+325
-25
lines changed

2 files changed

+325
-25
lines changed

tck/src/main/java/org/reactivestreams/tck/SubscriberBlackboxVerification.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public void setUp() throws Exception {
8989

9090
////////////////////// SPEC RULE VERIFICATION ///////////////////////////////
9191

92-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.1
9392
@Override @Test
9493
public void required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws Throwable {
9594
blackboxSubscriberTest(new BlackboxTestStageTestRun() {
@@ -105,13 +104,11 @@ public void run(BlackboxTestStage stage) throws InterruptedException {
105104
});
106105
}
107106

108-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.2
109107
@Override @Test
110108
public void untested_spec202_blackbox_shouldAsynchronouslyDispatch() throws Exception {
111109
notVerified(); // cannot be meaningfully tested, or can it?
112110
}
113111

114-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.3
115112
@Override @Test
116113
public void required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws Throwable {
117114
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -148,7 +145,6 @@ public void cancel() {
148145
});
149146
}
150147

151-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.3
152148
@Override @Test
153149
public void required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws Throwable {
154150
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -187,13 +183,11 @@ public void cancel() {
187183
});
188184
}
189185

190-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.4
191186
@Override @Test
192187
public void untested_spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws Exception {
193188
notVerified(); // cannot be meaningfully tested, or can it?
194189
}
195190

196-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.5
197191
@Override @Test
198192
public void required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws Exception {
199193
new BlackboxTestStage(env) {{
@@ -222,26 +216,22 @@ public String toString() {
222216
}};
223217
}
224218

225-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.6
226219
@Override @Test
227220
public void untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid() throws Exception {
228221
notVerified(); // cannot be meaningfully tested, or can it?
229222
}
230223

231-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.7
232224
@Override @Test
233225
public void untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws Exception {
234226
notVerified(); // cannot be meaningfully tested, or can it?
235227
// the same thread part of the clause can be verified but that is not very useful, or is it?
236228
}
237229

238-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.8
239230
@Override @Test
240231
public void untested_spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws Throwable {
241232
notVerified(); // cannot be meaningfully tested as black box, or can it?
242233
}
243234

244-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.9
245235
@Override @Test
246236
public void required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws Throwable {
247237
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -279,7 +269,6 @@ public void run(BlackboxTestStage stage) throws Throwable {
279269
});
280270
}
281271

282-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.9
283272
@Override @Test
284273
public void required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws Throwable {
285274
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -303,7 +292,6 @@ public void subscribe(Subscriber<? super T> s) {
303292
});
304293
}
305294

306-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.10
307295
@Override @Test
308296
public void required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws Throwable {
309297
blackboxSubscriberTest(new BlackboxTestStageTestRun() {
@@ -316,25 +304,21 @@ public void run(BlackboxTestStage stage) throws Throwable {
316304
});
317305
}
318306

319-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.11
320307
@Override @Test
321308
public void untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws Exception {
322309
notVerified(); // cannot be meaningfully tested, or can it?
323310
}
324311

325-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.12
326312
@Override @Test
327313
public void untested_spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality() throws Throwable {
328314
notVerified(); // cannot be meaningfully tested as black box, or can it?
329315
}
330316

331-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.13
332317
@Override @Test
333318
public void untested_spec213_blackbox_failingOnSignalInvocation() throws Exception {
334319
notVerified(); // cannot be meaningfully tested, or can it?
335320
}
336321

337-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.13
338322
@Override @Test
339323
public void required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws Throwable {
340324
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -357,7 +341,6 @@ public void run(BlackboxTestStage stage) throws Throwable {
357341
});
358342
}
359343

360-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.13
361344
@Override @Test
362345
public void required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws Throwable {
363346
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -385,7 +368,6 @@ public void run(BlackboxTestStage stage) throws Throwable {
385368
});
386369
}
387370

388-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#2.13
389371
@Override @Test
390372
public void required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws Throwable {
391373
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
@@ -415,43 +397,36 @@ public void run(BlackboxTestStage stage) throws Throwable {
415397

416398
////////////////////// SUBSCRIPTION SPEC RULE VERIFICATION //////////////////
417399

418-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.1
419400
@Override @Test
420401
public void untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext() throws Exception {
421402
notVerified(); // cannot be meaningfully tested, or can it?
422403
}
423404

424-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.8
425405
@Override @Test
426406
public void untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced() throws Throwable {
427407
notVerified(); // cannot be meaningfully tested as black box, or can it?
428408
}
429409

430-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.10
431410
@Override @Test
432411
public void untested_spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber() throws Exception {
433412
notVerified(); // cannot be meaningfully tested, or can it?
434413
}
435414

436-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.11
437415
@Override @Test
438416
public void untested_spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError() throws Exception {
439417
notVerified(); // cannot be meaningfully tested, or can it?
440418
}
441419

442-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.14
443420
@Override @Test
444421
public void untested_spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws Exception {
445422
notVerified(); // cannot be meaningfully tested, or can it?
446423
}
447424

448-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.15
449425
@Override @Test
450426
public void untested_spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError() throws Exception {
451427
notVerified(); // cannot be meaningfully tested, or can it?
452428
}
453429

454-
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#3.16
455430
@Override @Test
456431
public void untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws Exception {
457432
notVerified(); // cannot be meaningfully tested, or can it?

0 commit comments

Comments
 (0)