Skip to content

Commit 8f3350d

Browse files
committed
+tck 2.9 blackbox verification should fully drive publisher
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
1 parent c3dd8a1 commit 8f3350d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tck/src/main/java/org/reactivestreams/tck/SubscriberBlackboxVerification.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,19 @@ public void spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPreced
224224
blackboxSubscriberWithoutSetupTest(new BlackboxTestStageTestRun() {
225225
@Override
226226
public void run(BlackboxTestStage stage) throws Throwable {
227-
final Publisher<T> pub = createHelperPublisher(0);
227+
final Publisher<T> pub = new Publisher<T>() {
228+
@Override public void subscribe(final Subscriber<? super T> s) {
229+
s.onSubscribe(new Subscription() {
230+
@Override public void request(long n) {
231+
s.onComplete(); // Publisher now realises that it is in fact already completed
232+
}
233+
234+
@Override public void cancel() {
235+
// noop, ignore
236+
}
237+
});
238+
}
239+
};
228240

229241
final Subscriber<T> sub = createSubscriber();
230242
final BlackboxSubscriberProxy<T> probe = stage.createBlackboxSubscriberProxy(env, sub);

0 commit comments

Comments
 (0)