-
Notifications
You must be signed in to change notification settings - Fork 534
Ensure TCK passes with empty publisher that synchronously completes #423
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
Changes from 1 commit
61065a9
279f246
348dd26
7b4e52f
d7af539
603f719
8f1ec91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,18 @@ public void requireTestSkip(ThrowingRunnable run, String msgPart) { | |
throw new RuntimeException("Expected TCK to SKIP this test, instead if PASSed!"); | ||
} | ||
|
||
public void requireOptionalTestPass(ThrowingRunnable run) { | ||
try { | ||
run.run(); | ||
} catch (SkipException skip) { | ||
throw new RuntimeException("Expected TCK to PASS this test, instead it was SKIPPED", skip.getCause()); | ||
} catch (Throwable throwable) { | ||
throw new RuntimeException( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repackage Errors as Exceptions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just being consistent with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not really matter much as those will end up failing the test in the suite and one may always look into the logs. It's not like it's a production app where we have to watch out to not accidentally continue after an OOM or something... Fine as is I think |
||
String.format("Expected TCK to PASS this test, yet it threw %s(%s) instead!", | ||
throwable.getClass().getName(), throwable.getMessage()), throwable); | ||
} | ||
} | ||
|
||
/** | ||
* This publisher does NOT fulfil all Publisher spec requirements. | ||
* It's just the bare minimum to enable this test to fail the Subscriber tests. | ||
|
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.
There is a completeImmediately() method on the promise.
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.
Btw. the plain
complete()
behavior is odd. I'd think once called,isCompleted()
should report true but the implementation queues the object.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.
I agree - but I'm not familiar enough with the TCK to change it. Though I can understand why the event is queued, so that the order of events can be verified and duplicates can be detected etc.
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.
I'll investigate this
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.
Thanks for noticing, I think we can improve the impl there. I'll work on it today after done with work stuff.
I'll PR into this PR then :)
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.
I reimplemented the Promise which makes this workwithout the additional atomic.
Please see here: jroper#1