Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCK: Fail early if registerOnSubscribe is not called #418

Merged

Conversation

akarnokd
Copy link
Contributor

@akarnokd akarnokd commented Dec 4, 2017

This PR makes sure the TCK checks if the WhiteboxSubscriberProbe.registerOnSubscribe() was called before any test body tries to use the (unavailable) puppet, crashing with NullPointerException and hiding the fact the method call was missing.

Fixes: #416

@@ -539,6 +539,7 @@ public WhiteboxTestStage(TestEnvironment env, boolean runDefaultInit) throws Int
probe = new WhiteboxSubscriberProbe<T>(env, subscriber);
subscribe(createSubscriber(probe));
probe.puppet.expectCompletion(env.defaultTimeoutMillis(), String.format("Subscriber %s did not `registerOnSubscribe`", sub()));
env.verifyNoAsyncErrorsNoDelay();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, @akarnokd! 👍

Copy link
Contributor

@viktorklang viktorklang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@reactive-streams/contributors wdyt?

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and nice test to go with it -- thanks

@ktoso ktoso mentioned this pull request Dec 5, 2017
@viktorklang
Copy link
Contributor

@reactive-streams/contributors Alright, merging this TCK change as it doesn't impact any RS semantics.

@viktorklang viktorklang merged commit 42b0a70 into reactive-streams:master Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants