Search in sources :

Example 16 with TestCompletableSubscriber

use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.

the class IterableMergeCompletableDelayErrorTest method testIterableCompletionFew.

@Test
void testIterableCompletionFew() {
    TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
    iterableHolder.init(2).listen(subscriber).complete(1, 2);
    assertThat(subscriber.pollTerminal(10, MILLISECONDS), is(nullValue()));
    iterableHolder.complete(0);
    subscriber.awaitOnComplete();
}
Also used : TestCompletableSubscriber(io.servicetalk.concurrent.test.internal.TestCompletableSubscriber) Test(org.junit.jupiter.api.Test)

Example 17 with TestCompletableSubscriber

use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.

the class IterableMergeCompletableTest method mergeEmptyArray.

@Test
void mergeEmptyArray() {
    TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
    toSource(completed().merge(new Completable[0])).subscribe(subscriber);
    subscriber.awaitOnComplete();
}
Also used : TestCompletableSubscriber(io.servicetalk.concurrent.test.internal.TestCompletableSubscriber) Test(org.junit.jupiter.api.Test)

Example 18 with TestCompletableSubscriber

use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.

the class IterableMergeCompletableTest method testIterableCompletionFew.

@Test
void testIterableCompletionFew() {
    TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
    iterableHolder.init(2).listen(subscriber).complete(1, 2);
    assertThat(subscriber.pollTerminal(10, MILLISECONDS), is(nullValue()));
    iterableHolder.complete(0);
    subscriber.awaitOnComplete();
}
Also used : TestCompletableSubscriber(io.servicetalk.concurrent.test.internal.TestCompletableSubscriber) Test(org.junit.jupiter.api.Test)

Example 19 with TestCompletableSubscriber

use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.

the class IterableMergeCompletableTest method testIterableMergeWithOne.

@Test
void testIterableMergeWithOne() {
    TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
    iterableHolder.init(1).listen(subscriber).completeAll();
    subscriber.awaitOnComplete();
}
Also used : TestCompletableSubscriber(io.servicetalk.concurrent.test.internal.TestCompletableSubscriber) Test(org.junit.jupiter.api.Test)

Example 20 with TestCompletableSubscriber

use of io.servicetalk.concurrent.test.internal.TestCompletableSubscriber in project servicetalk by apple.

the class IterableMergeCompletableTest method mergeEmptyCollection.

@Test
void mergeEmptyCollection() {
    TestCompletableSubscriber subscriber = new TestCompletableSubscriber();
    toSource(completed().merge(Collections.emptyList())).subscribe(subscriber);
    subscriber.awaitOnComplete();
}
Also used : TestCompletableSubscriber(io.servicetalk.concurrent.test.internal.TestCompletableSubscriber) Test(org.junit.jupiter.api.Test)

Aggregations

TestCompletableSubscriber (io.servicetalk.concurrent.test.internal.TestCompletableSubscriber)60 Test (org.junit.jupiter.api.Test)53 Completable (io.servicetalk.concurrent.api.Completable)11 BeforeEach (org.junit.jupiter.api.BeforeEach)5 TestCompletable (io.servicetalk.concurrent.api.TestCompletable)4 ContextAwareRetryingHttpClientFilter (io.servicetalk.http.netty.RetryingHttpRequesterFilter.ContextAwareRetryingHttpClientFilter)2 Channel (io.netty.channel.Channel)1 ChannelFuture (io.netty.channel.ChannelFuture)1 ChannelFutureListener (io.netty.channel.ChannelFutureListener)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 ChannelOutboundHandlerAdapter (io.netty.channel.ChannelOutboundHandlerAdapter)1 ChannelPromise (io.netty.channel.ChannelPromise)1 EventLoop (io.netty.channel.EventLoop)1 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)1 ReferenceCountUtil (io.netty.util.ReferenceCountUtil)1 Cancellable (io.servicetalk.concurrent.Cancellable)1 TestSubscription (io.servicetalk.concurrent.api.TestSubscription)1 DeliberateException (io.servicetalk.concurrent.internal.DeliberateException)1 DELIBERATE_EXCEPTION (io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION)1 UNSUPPORTED_PROTOCOL_CLOSE_HANDLER (io.servicetalk.transport.netty.internal.CloseHandler.UNSUPPORTED_PROTOCOL_CLOSE_HANDLER)1