Skip to content

Commit b4f359f

Browse files
committed
Removes the Annotations.java from the TCK and replaces it with prefixing
TCK Verification methods with "required"/"optional"/"unverified"/"stochastic" instead. This means that it is easy to change level by introducing a new method prefixed with the updated requirement and deprecating the old method.
1 parent d380acc commit b4f359f

12 files changed

+536
-597
lines changed

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

-60
This file was deleted.

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

+173-174
Large diffs are not rendered by default.

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

+73-74
Large diffs are not rendered by default.

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

+44-46
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import org.testng.annotations.BeforeMethod;
1313
import org.testng.annotations.Test;
1414

15-
import static org.reactivestreams.tck.Annotations.NotVerified;
16-
import static org.reactivestreams.tck.Annotations.Required;
1715
import static org.reactivestreams.tck.SubscriberWhiteboxVerification.BlackboxSubscriberProxy;
1816

1917
/**
@@ -68,8 +66,8 @@ public void setUp() throws Exception {
6866
////////////////////// SPEC RULE VERIFICATION ///////////////////////////////
6967

7068
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.1
71-
@Override @Required @Test
72-
public void spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws Throwable {
69+
@Override @Test
70+
public void required___spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws Throwable {
7371
blackboxSubscriberTest(new BlackboxTestStageTestRun() {
7472
@Override
7573
public void run(BlackboxTestStage stage) throws InterruptedException {
@@ -83,14 +81,14 @@ public void run(BlackboxTestStage stage) throws InterruptedException {
8381
}
8482

8583
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.2
86-
@Override @NotVerified @Test
87-
public void spec202_blackbox_shouldAsynchronouslyDispatch() throws Exception {
84+
@Override @Test
85+
public void unverified___spec202_blackbox_shouldAsynchronouslyDispatch() throws Exception {
8886
notVerified(); // cannot be meaningfully tested, or can it?
8987
}
9088

9189
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.3
92-
@Override @Required @Test
93-
public void spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws Throwable {
90+
@Override @Test
91+
public void required___spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws Throwable {
9492
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
9593
@Override
9694
public void run(BlackboxTestStage stage) throws Throwable {
@@ -126,8 +124,8 @@ public void cancel() {
126124
}
127125

128126
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.3
129-
@Override @Required @Test
130-
public void spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws Throwable {
127+
@Override @Test
128+
public void required___spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws Throwable {
131129
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
132130
@Override
133131
public void run(BlackboxTestStage stage) throws Throwable {
@@ -165,14 +163,14 @@ public void cancel() {
165163
}
166164

167165
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.4
168-
@Override @NotVerified @Test
169-
public void spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws Exception {
166+
@Override @Test
167+
public void unverified___spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws Exception {
170168
notVerified(); // cannot be meaningfully tested, or can it?
171169
}
172170

173171
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.5
174-
@Override @Required @Test
175-
public void spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws Exception {
172+
@Override @Test
173+
public void required___spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws Exception {
176174
new BlackboxTestStage(env) {{
177175
// try to subscribe another time, if the subscriber calls `probe.registerOnSubscribe` the test will fail
178176
final TestEnvironment.Latch secondSubscriptionCancelled = new TestEnvironment.Latch(env);
@@ -200,27 +198,27 @@ public String toString() {
200198
}
201199

202200
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.6
203-
@Override @NotVerified @Test
204-
public void spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid() throws Exception {
201+
@Override @Test
202+
public void unverified___spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid() throws Exception {
205203
notVerified(); // cannot be meaningfully tested, or can it?
206204
}
207205

208206
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.7
209-
@Override @NotVerified @Test
210-
public void spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws Exception {
207+
@Override @Test
208+
public void unverified___spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws Exception {
211209
notVerified(); // cannot be meaningfully tested, or can it?
212210
// the same thread part of the clause can be verified but that is not very useful, or is it?
213211
}
214212

215213
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.8
216-
@Override @NotVerified @Test
217-
public void spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws Throwable {
214+
@Override @Test
215+
public void unverified___spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws Throwable {
218216
notVerified(); // cannot be meaningfully tested as black box, or can it?
219217
}
220218

221219
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.9
222-
@Override @Required @Test
223-
public void spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws Throwable {
220+
@Override @Test
221+
public void required___spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws Throwable {
224222
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
225223
@Override
226224
public void run(BlackboxTestStage stage) throws Throwable {
@@ -239,8 +237,8 @@ public void run(BlackboxTestStage stage) throws Throwable {
239237
}
240238

241239
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.9
242-
@Override @Required @Test
243-
public void spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws Throwable {
240+
@Override @Test
241+
public void required___spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws Throwable {
244242
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
245243
@Override
246244
public void run(BlackboxTestStage stage) throws Throwable {
@@ -263,8 +261,8 @@ public void subscribe(Subscriber<? super T> s) {
263261
}
264262

265263
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.10
266-
@Override @Required @Test
267-
public void spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws Throwable {
264+
@Override @Test
265+
public void required___spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws Throwable {
268266
blackboxSubscriberTest(new BlackboxTestStageTestRun() {
269267
@Override
270268
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@@ -276,64 +274,64 @@ public void run(BlackboxTestStage stage) throws Throwable {
276274
}
277275

278276
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.11
279-
@Override @NotVerified @Test
280-
public void spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws Exception {
277+
@Override @Test
278+
public void unverified___spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws Exception {
281279
notVerified(); // cannot be meaningfully tested, or can it?
282280
}
283281

284282
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.12
285-
@Override @Required @Test
286-
public void spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality() throws Throwable {
283+
@Override @Test
284+
public void required___spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality() throws Throwable {
287285
notVerified(); // cannot be meaningfully tested as black box, or can it?
288286
}
289287

290288
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.13
291-
@Override @NotVerified @Test
292-
public void spec213_blackbox_failingOnSignalInvocation() throws Exception {
289+
@Override @Test
290+
public void unverified___spec213_blackbox_failingOnSignalInvocation() throws Exception {
293291
notVerified(); // cannot be meaningfully tested, or can it?
294292
}
295293

296294
////////////////////// SUBSCRIPTION SPEC RULE VERIFICATION //////////////////
297295

298296
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.1
299-
@Override @NotVerified @Test
300-
public void spec301_blackbox_mustNotBeCalledOutsideSubscriberContext() throws Exception {
297+
@Override @Test
298+
public void unverified___spec301_blackbox_mustNotBeCalledOutsideSubscriberContext() throws Exception {
301299
notVerified(); // cannot be meaningfully tested, or can it?
302300
}
303301

304302
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.8
305-
@Override @Required @Test
306-
public void spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced() throws Throwable {
303+
@Override @Test
304+
public void required___spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced() throws Throwable {
307305
notVerified(); // cannot be meaningfully tested as black box, or can it?
308306
}
309307

310308
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.10
311-
@Override @NotVerified @Test
312-
public void spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber() throws Exception {
309+
@Override @Test
310+
public void unverified___spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber() throws Exception {
313311
notVerified(); // cannot be meaningfully tested, or can it?
314312
}
315313

316314
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.11
317-
@Override @NotVerified @Test
318-
public void spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError() throws Exception {
315+
@Override @Test
316+
public void unverified___spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError() throws Exception {
319317
notVerified(); // cannot be meaningfully tested, or can it?
320318
}
321319

322320
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.14
323-
@Override @NotVerified @Test
324-
public void spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws Exception {
321+
@Override @Test
322+
public void unverified___spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws Exception {
325323
notVerified(); // cannot be meaningfully tested, or can it?
326324
}
327325

328326
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.15
329-
@Override @NotVerified @Test
330-
public void spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError() throws Exception {
327+
@Override @Test
328+
public void unverified___spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError() throws Exception {
331329
notVerified(); // cannot be meaningfully tested, or can it?
332330
}
333331

334332
// Verifies rule: https://github.com/reactive-streams/reactive-streams#3.16
335-
@Override @NotVerified @Test
336-
public void spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws Exception {
333+
@Override @Test
334+
public void unverified___spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws Exception {
337335
notVerified(); // cannot be meaningfully tested, or can it?
338336
}
339337

0 commit comments

Comments
 (0)