Search in sources :

Example 1 with RegistrationException

use of io.aeron.exceptions.RegistrationException in project Aeron by real-logic.

the class ChannelValidationTests method shouldNotAllowUriParametersForManualMdc.

@ParameterizedTest
@ValueSource(strings = { "mtu", "rcv-wnd", "so-rcvbuf", "so-sndbuf" })
void shouldNotAllowUriParametersForManualMdc(final String parameter) {
    launch();
    final Publication publication = addPublication("aeron:udp?control-mode=manual", 1000);
    final RegistrationException registrationException = assertThrows(RegistrationException.class, () -> publication.addDestination("aeron:udp?endpoint=localhost:9999|" + parameter + "=4096"));
    assertThat(registrationException.getMessage(), containsString(parameter));
}
Also used : RegistrationException(io.aeron.exceptions.RegistrationException) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with RegistrationException

use of io.aeron.exceptions.RegistrationException in project Aeron by real-logic.

the class MultiDestinationCastTest method addDestinationWithSpySubscriptionsShouldFailWithRegistrationException.

@Test
@InterruptAfter(10)
void addDestinationWithSpySubscriptionsShouldFailWithRegistrationException() {
    final ErrorHandler mockErrorHandler = mock(ErrorHandler.class);
    launch(mockErrorHandler);
    publication = clientA.addPublication(PUB_MDC_MANUAL_URI, STREAM_ID);
    final RegistrationException registrationException = assertThrows(RegistrationException.class, () -> publication.addDestination(CommonContext.SPY_PREFIX + PUB_MDC_DYNAMIC_URI));
    assertThat(registrationException.getMessage(), containsString("spies are invalid"));
}
Also used : ErrorHandler(org.agrona.ErrorHandler) RegistrationException(io.aeron.exceptions.RegistrationException) Test(org.junit.jupiter.api.Test)

Example 3 with RegistrationException

use of io.aeron.exceptions.RegistrationException in project Aeron by real-logic.

the class ChannelValidationTests method shouldNotAllowUriParametersForManualMds.

@ParameterizedTest
@ValueSource(strings = { "mtu", "rcv-wnd", "so-rcvbuf", "so-sndbuf" })
void shouldNotAllowUriParametersForManualMds(final String parameter) {
    launch();
    final Subscription subscription = addSubscription("aeron:udp?control-mode=manual", 1000);
    final RegistrationException registrationException = assertThrows(RegistrationException.class, () -> subscription.addDestination("aeron:udp?endpoint=localhost:9999|" + parameter + "=4096"));
    assertThat(registrationException.getMessage(), containsString(parameter));
}
Also used : RegistrationException(io.aeron.exceptions.RegistrationException) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

RegistrationException (io.aeron.exceptions.RegistrationException)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 ValueSource (org.junit.jupiter.params.provider.ValueSource)2 ErrorHandler (org.agrona.ErrorHandler)1 Test (org.junit.jupiter.api.Test)1