Skip to content

TCK support for restricted length Producers and Consumers #87

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

Closed
richdougherty opened this issue Jul 21, 2014 · 4 comments
Closed

TCK support for restricted length Producers and Consumers #87

richdougherty opened this issue Jul 21, 2014 · 4 comments

Comments

@richdougherty
Copy link

I know the 0.3 TCK is out of date and a new TCK will be written at some point. Please consider this a feature request any new TCK.

The 0.3 TCK has support for verifying Producers and Consumers. I'll talk about Producer testing here, but the same idea applies to Consumer testing too.

Users of the ProducerVerificationTest need to implement createPublisher(elements: Int) and construct a Publisher of length elements (with an argument of 0 meaning a stream of infinite length).

In my situation I wasn't able to satisfy the requirements of this method because the Producer I was creating only supported streams with exactly 1 element.

What I'd like to suggest is that, in any future TCK, there are options to specify the valid lengths of the stream that is being tested. For example, some streams might support only 0, 1 or finite lengths.

@ktoso
Copy link
Contributor

ktoso commented Jul 21, 2014

Thanks for the feedback Rich,
the use case would be like an FromFuturePublisher, so it only can send up to 1 element, right?

We'll try to figure something out, may be easy enough to integrate your request.

@richdougherty
Copy link
Author

Yes, my use case is single-element publishers and consumers made by wrapping Scala's futures and promises. I can also imagine zero-element versions of publishers and consumers (Publisher.empty, Consumer.empty) and versions of publishers and consumers that can only handle finite lengths (Publisher.fromArray, Consumer.toArray).

@ktoso ktoso mentioned this issue Jul 29, 2014
6 tasks
@ktoso
Copy link
Contributor

ktoso commented Aug 11, 2014

So my current suggestion would be (as seen in PR #91):

  @Override 
  public long maxElementsFromPublisher() { return 1; }

Which skips all tests which require more than 1 element to run (so currently, most of them: Total tests run: 18, Failures: 0, Skips: 13 (publisher specs)). The skip message includes this as the reason. Opinions about this way of exposing publisher capabilities?

@viktorklang
Copy link
Contributor

Looks like it was solved to me. Closing.

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

No branches or pull requests

3 participants