io.reactivex.exceptions.MissingBackpressureException Java Examples

The following examples show how to use io.reactivex.exceptions.MissingBackpressureException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NoKafkaTest.java    From smallrye-reactive-messaging with Apache License 2.0 5 votes vote down vote up
@Test
public void testOutgoingWithoutKafkaClusterWithoutBackPressure() throws InterruptedException {
    container = KafkaTestBase.baseWeld();
    KafkaTestBase.addConfig(myKafkaSinkConfig());
    container.addBeanClasses(MyOutgoingBeanWithoutBackPressure.class);
    WeldContainer weld = this.container.initialize();

    nap();

    MyOutgoingBeanWithoutBackPressure bean = weld
            .select(MyOutgoingBeanWithoutBackPressure.class).get();
    Throwable throwable = bean.error();
    assertThat(throwable).isNotNull();
    assertThat(throwable).isInstanceOf(MissingBackpressureException.class);
}
 
Example #2
Source File: OcraftS2ClientStressIT.java    From ocraft-s2client with MIT License 5 votes vote down vote up
@Test
void emitsErrorOnResponseStreamBufferOverflow() {
    System.setProperty(OcraftApiConfig.CLIENT_BUFFER_SIZE_RESPONSE_STREAM, "1");
    System.setProperty(OcraftApiConfig.CLIENT_BUFFER_SIZE_RESPONSE_EVENT_BUS, String.valueOf(ITERATION_COUNT));
    System.setProperty(OcraftApiConfig.CLIENT_BUFFER_SIZE_RESPONSE_BACKPRESSURE, "1");

    refreshConfig();

    prepareGame();
    TestS2ClientSubscriber subscriber = TestS2ClientSubscriber.withBackPressure();
    client.responseStream().subscribe(subscriber);
    startRequestStream();

    assertThatSubscriberReceivedError(subscriber, MissingBackpressureException.class);
}
 
Example #3
Source File: FlowableIntegrationTest.java    From tutorials with MIT License 5 votes vote down vote up
@Test public void whenMissingStrategyUsed_thenException() {
    Observable observable = Observable.range(1, 100000);
    TestSubscriber subscriber = observable.toFlowable(BackpressureStrategy.MISSING).observeOn(Schedulers.computation()).test();

    subscriber.awaitTerminalEvent();
    subscriber.assertError(MissingBackpressureException.class);
}
 
Example #4
Source File: FlowableIntegrationTest.java    From tutorials with MIT License 5 votes vote down vote up
@Test public void  whenErrorStrategyUsed_thenExceptionIsThrown() {
        Observable observable = Observable.range(1, 100000);
    TestSubscriber subscriber = observable.toFlowable(BackpressureStrategy.ERROR).observeOn(Schedulers.computation()).test();

    subscriber.awaitTerminalEvent();
    subscriber.assertError(MissingBackpressureException.class);
}