-
Notifications
You must be signed in to change notification settings - Fork 534
+tck #181 provides default helperPublisher for subscriber tests #186
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
Conversation
@@ -17,7 +17,7 @@ | |||
|
|||
* NOTE: The code below uses a lot of try-catches to show the reader where exceptions can be expected, and where they are forbidden. | |||
*/ | |||
class AsyncIterablePublisher<T> implements Publisher<T> { | |||
public class AsyncIterablePublisher<T> implements Publisher<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those need to be public as we want to reuse them. // cc @viktorklang - I think you just missed making the public by accident? Or was it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scala has spoiled me. Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't want to say so directly :-) default public for the win! :-)
@ktoso rebase on top of current master and you'll get the fixes in the PR above. |
@ktoso Let me know when there's anything new to review. Thanks! |
Was planning yesterday but it made some tests fail in weird ways. Maybe Konrad
|
7a6b426
to
c3dd8a1
Compare
Hey @viktorklang so you can have a look at ktoso@c3dd8a1 while it's currently failing some tests and I didn't yet investigate why (perhaps making the helper async broke assumptions in those tests - pretty probable). I'm still around tomorrow but then off for a week of skiing so don't expect to be able to code much.. If you like the idea you can use these commits as a basis, or we'll continue when I'm back I guess |
@viktorklang / @reactive-streams/contributors pushed last commit which fixes our relying on the helper publisher to exhibit a certain behaviour (in terms on when to onComplete). In this specific test we should instead drive the publisher by ourselfes. The whitebox versions of these tests are OK. This change both makes sense and unbreaks the build ;-) Let me know once you review so I can squash the changes (note: I have random internet access this week). |
8f3350d
to
4c5361d
Compare
private AtomicBoolean completed = new AtomicBoolean(); | ||
|
||
@Override public void request(long n) { | ||
if (completed.compareAndSet(false, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for atomic, request is only allowed to be called from the subscriber anyway?
Aside from comments, LGTM! |
@reactive-streams/contributors Please have a look/vote/ask for more time before the 2nd of January 2015, as this should/could go into the RC2, thanks! |
4c5361d
to
9592f96
Compare
…iber tests + When subscriber verifications are extended using Integer we can use the existing publisher implementations from examples to drive the tests. This allows implementers who only care about implementing Subscribers to not care at all about implementing Publishers + In case the subscriber verification is extended using a custom signal type (defined as "not Integer") we do not magically generate a Publisher of this type, but instead fail the tests telling the implementer that he/she will need to implement a custom helperPublisher which is exactly what we have up until now always demanded from implementations. + We also provide tests to verify the test failures work as expected, and that the messages are indeed helpful. + Updated TCK README.md to clarify when to implement a custom publisher + fixed mistakenly added `<T>` on NumberPublisher - it is bound to Ints + TCK now depends on examples, as it uses the well documented async publisher to provide the default publisher for numbers. As well as in order to allow implementers to reuse those publishers when implementing custom Publishers to drive their Subscriber specs. ! Moved away from createHelper to createElement style of testing subscribers
9592f96
to
c9ccec4
Compare
It should not use the helper publisher as it may signal asynchronously as well as onComplete in undefined ways - we need to control the publisher in this case because of the very specific test scenario
c9ccec4
to
cf715fa
Compare
I've addressed all comments except the Function one now. |
Superseded by #192 (rebased on top of current master). |
rebasing and reopening to verify if validation would/will fail. |
Oh... no re-opening powers... :-( |
This is a rather heavy PR, however it removes the need of implementing a (helper) Publisher when I'm only interested in implementing a Subscriber. This is done by providing a default implementation - based on the example implementations (reused).
The TCK automatically picks the default publisher if it is able to. If not (types don't match), it fails ASAP and tells the implementer that he/she has to implement a custom publisher (like we, until now, always forced implementers to).
Let me know what you think!
Refs #181
Merry 🎄 ;-)