Skip to content

Removes the use of annotations, switches to test prefix naming #189

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

Merged
merged 3 commits into from
Jan 2, 2015

Conversation

viktorklang
Copy link
Contributor

Introduces interfaces to specify which tests should be implemented for the different *Verification classes, which makes it much easier to keep track that test cases have been properly implemented.

IMPORTANT Fixes #188 by making the 2.12 rule "untested" in the TCK as it is not reasonably testable.

Removes the annotations that were used for TCK documentation, since they were confusing and not up to date. Replaces them with prefix naming. ("optional"/"required"/"untested"/"stochastic")

@smaldini
Copy link
Contributor

Trying

@smaldini
Copy link
Contributor

Mhhh looks like it still tries the test, should I override myself in the end-test with @Additional too ?

@viktorklang
Copy link
Contributor Author

Shouldn't have to, but try.

Cheers,

On 29 Dec 2014 13:43, "Stephane Maldini" [email protected] wrote:

Mhhh looks like it still tries the test, should I override myself in the
end-test with @Additional too ?


Reply to this email directly or view it on GitHub
#189 (comment)
.

@smaldini
Copy link
Contributor

Ahaha can't its package scope :) Note to be sure I have incremented the version to RC2.BUILD-SNAPSHOT.

This works

    @Override
    @org.testng.annotations.Test
    public void spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation() throws Throwable {
    }

@smaldini
Copy link
Contributor

I can also implement some logic to switch to an hot stream in this override but I suppose the goal is to have the TCK itself flexible on that rule.

@viktorklang viktorklang force-pushed the wip-fix-identityprocessorverification-√ branch from ac90001 to 54898e9 Compare December 29, 2014 14:28
@viktorklang
Copy link
Contributor Author

Does this work?

@Override
    @org.testng.annotations.Test
    @Additional
    public void spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation() throws Throwable {
       super.spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation();
    }

@viktorklang
Copy link
Contributor Author

I just pushed a new commit where I introduce interfaces to keep track that the right methods are reflected in both the Publisher, Subscriber and Processor verifications.

@viktorklang
Copy link
Contributor Author

Can you try this branch?

@viktorklang viktorklang force-pushed the wip-fix-identityprocessorverification-√ branch from 54898e9 to 7aadee3 Compare December 29, 2014 14:50
@viktorklang viktorklang changed the title Ttransfers/copies all test annotations from the Publisher/Subscriber Ver... Transfers/copies all test annotations from the Publisher/Subscriber Ver... Dec 29, 2014
@smaldini
Copy link
Contributor

@Additional is package scoped like other TCK annotations. Going to try the latest commit in a min.

…erifications

to the IdentityProcessor-verification so that they are applied for the delegation.

Introduces SubscriberWhiteboxVerificationRules, SubscriberBlackboxVerificationRules and
PubisherVerificationRules to keep track of and assist in making sure that all tests
propagate properly between Subscriber, Publisher and Processor.
@viktorklang
Copy link
Contributor Author

@smaldini nevermind the annotations, they are only documentation AFAIK

@viktorklang viktorklang force-pushed the wip-fix-identityprocessorverification-√ branch from 7aadee3 to d380acc Compare December 29, 2014 15:47
@smaldini
Copy link
Contributor

Still testing (and failing) 2.12 for me without override Noop.

@ktoso
Copy link
Contributor

ktoso commented Dec 29, 2014

@smaldini
Copy link
Contributor

As annotation is just doc, maybe we should remove @Test from 212 and leave the implementation override and add the test scope. Or we add the annotations handling and an Environment boolean to enable/disable testing for @Additional specs.

@ktoso
Copy link
Contributor

ktoso commented Dec 29, 2014

// Sorry, my crappy internet connection made me think I sent an additional comment here but it seems I did not. I'm in the mountains for a week - sorry for not being too responsive over this week!

I'll open a separate issue about what to do with those annotations. Seems that they being just docs can be quite misleading - we're all accustomed to annotations "doing all the things" I guess. An idea would be to instead of separate optionalSubscriberTestWithoutSetup / subscriberTest make it simply use these annotations..

Made it a ticket: #190

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.
@viktorklang
Copy link
Contributor Author

This PR should also fix #190

@viktorklang viktorklang changed the title Transfers/copies all test annotations from the Publisher/Subscriber Ver... Removes the use of annotations, switches to test prefix naming Dec 29, 2014
@viktorklang viktorklang added this to the 1.0.0.RC2 milestone Dec 30, 2014
@viktorklang viktorklang self-assigned this Dec 30, 2014
@viktorklang
Copy link
Contributor Author

@reactive-streams/contributors Please review/vote/ask for more time before the 2nd of January 2015, this change needs to go into an RC2.

errorPublisherTest(new PublisherTestRun<T>() {
@Override @Test
public void optional___spec112_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorInsteadOfOnSubscribe() throws Throwable {
errorPublisherTest(new PublisherTestRun<T>() { //FIXME shouldn't this be some "optional" method??? Method was marked as @Additional
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ktoso would like you take on this comment

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, this is a case of confusing naming I think. It is indeed optional - the way errorPublisherTest works is "if the publisher I get from createErrorPublisher() (user does this), is not null, I'm doing to run this test"). Let's rename the method name to optionalErrorPublisherTest and we're good here IMO

optionalActivePublisherTest(3, false, new PublisherTestRun<T>() {
@Override @Test
public void required___spec113_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront() throws Throwable {
optionalActivePublisherTest(3, false, new PublisherTestRun<T>() { // FIXME shouldn't this be a non-"optional" method??? Method was marked as @Required
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ktoso would like you take on this comment

Copy link
Contributor

Choose a reason for hiding this comment

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

The optional method is here because "same order of elements" in this test is checked after a number of elements being signalled. But what if the publisher can only ever signal 1 time (e.g. FutureSource), in that case the TCK skips this test even though its "required", but well, this Publisher cannot be tested using this test.

@ktoso
Copy link
Contributor

ktoso commented Dec 30, 2014

This PR misses updating the tck/README.md about our wording used here.
Possibly add a word or two about how we plan to evolve the tck using thie style of methods?

@viktorklang
Copy link
Contributor Author

@ktoso Nice catch, I'll have a look at the RCK README and see if I can improve it.

@ktoso
Copy link
Contributor

ktoso commented Dec 30, 2014

I also touched the README in my PR, I think we'll get conflicts on that one hm..
I'm out of brain power for today to go over the other lines in this PR without making a mistake now I fear, I'll get to those soon I hope - in general I'd say "trust the code, not the annotation" in cases we had a mistake.

@viktorklang viktorklang force-pushed the wip-fix-identityprocessorverification-√ branch from ee3408e to 9cce1cd Compare December 30, 2014 23:08
@viktorklang
Copy link
Contributor Author

Renamed "unverified" to "untested" (same length as "optional" and "required")
Changed ___ to _

@ktoso
Copy link
Contributor

ktoso commented Dec 31, 2014

Went through the FIXMEs, it's those cases we've added recently to support weird publishers "can only signal 1 element" and "can never signal oncomplete" etc. Those tests are required in general, but can be forced to skip if you configure the TCK by telling it "my publisher can not signal completion" etc.

These are explained in the tck/README.md section 'Testing Publishers with restricted capabilities'. Let me know if we should improve the wording there or do something else.

@ktoso
Copy link
Contributor

ktoso commented Dec 31, 2014

Single underscore + rename works great, thanks! :)

@viktorklang
Copy link
Contributor Author

Pushed changes based on @ktoso's feedback

@ktoso
Copy link
Contributor

ktoso commented Dec 31, 2014

LGTM :-)

…stically verified.

Introduces prefix naming for TCK rules using "required_", "optional_", "untested_" and "stochastic_".

Updates tck/README.md to reflect these changes

Deletes the Annotations.java file as the annotations are no longer used.

Introduces interfaces for the TCK test methods so it is possible to keep track of implementations,
perform deprecations etc.
@viktorklang viktorklang force-pushed the wip-fix-identityprocessorverification-√ branch from e6f057f to 41cd764 Compare January 1, 2015 21:57
@viktorklang
Copy link
Contributor Author

No objections, merging :)

viktorklang added a commit that referenced this pull request Jan 2, 2015
…orverification-√

Removes the use of annotations, switches to test prefix naming
@viktorklang viktorklang merged commit 93415d1 into master Jan 2, 2015
@viktorklang viktorklang deleted the wip-fix-identityprocessorverification-√ branch January 2, 2015 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spec. 2. 12 TCK : Testing a unicast publisher
3 participants