Search in sources :

Example 1 with LoggingErrorHandler

use of org.agrona.concurrent.errors.LoggingErrorHandler in project Aeron by real-logic.

the class CommonContextTest method setupErrorHandlerReturnsALoggingErrorHandlerInstanceIfNoUserErrorHandlerSupplied.

@Test
void setupErrorHandlerReturnsALoggingErrorHandlerInstanceIfNoUserErrorHandlerSupplied() {
    final DistinctErrorLog distinctErrorLog = mock(DistinctErrorLog.class);
    final ErrorHandler errorHandler = CommonContext.setupErrorHandler(null, distinctErrorLog);
    assertNotNull(errorHandler);
    final LoggingErrorHandler loggingErrorHandler = assertInstanceOf(LoggingErrorHandler.class, errorHandler);
    assertSame(distinctErrorLog, loggingErrorHandler.distinctErrorLog());
}
Also used : DistinctErrorLog(org.agrona.concurrent.errors.DistinctErrorLog) ErrorHandler(org.agrona.ErrorHandler) LoggingErrorHandler(org.agrona.concurrent.errors.LoggingErrorHandler) LoggingErrorHandler(org.agrona.concurrent.errors.LoggingErrorHandler) Test(org.junit.jupiter.api.Test)

Example 2 with LoggingErrorHandler

use of org.agrona.concurrent.errors.LoggingErrorHandler in project aeron by real-logic.

the class CommonContextTest method setupErrorHandlerReturnsALoggingErrorHandlerInstanceIfNoUserErrorHandlerSupplied.

@Test
void setupErrorHandlerReturnsALoggingErrorHandlerInstanceIfNoUserErrorHandlerSupplied() {
    final DistinctErrorLog distinctErrorLog = mock(DistinctErrorLog.class);
    final ErrorHandler errorHandler = CommonContext.setupErrorHandler(null, distinctErrorLog);
    assertNotNull(errorHandler);
    final LoggingErrorHandler loggingErrorHandler = assertInstanceOf(LoggingErrorHandler.class, errorHandler);
    assertSame(distinctErrorLog, loggingErrorHandler.distinctErrorLog());
}
Also used : DistinctErrorLog(org.agrona.concurrent.errors.DistinctErrorLog) ErrorHandler(org.agrona.ErrorHandler) LoggingErrorHandler(org.agrona.concurrent.errors.LoggingErrorHandler) LoggingErrorHandler(org.agrona.concurrent.errors.LoggingErrorHandler) Test(org.junit.jupiter.api.Test)

Aggregations

ErrorHandler (org.agrona.ErrorHandler)2 DistinctErrorLog (org.agrona.concurrent.errors.DistinctErrorLog)2 LoggingErrorHandler (org.agrona.concurrent.errors.LoggingErrorHandler)2 Test (org.junit.jupiter.api.Test)2