Search in sources :

Example 1 with RethrowingErrorHandler

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

the class ConsensusModuleContextTest method beforeEach.

@BeforeEach
void beforeEach() {
    final Aeron.Context aeronContext = mock(Aeron.Context.class);
    when(aeronContext.subscriberErrorHandler()).thenReturn(new RethrowingErrorHandler());
    final AgentInvoker conductorInvoker = mock(AgentInvoker.class);
    final Aeron aeron = mock(Aeron.class);
    when(aeron.context()).thenReturn(aeronContext);
    when(aeron.conductorAgentInvoker()).thenReturn(conductorInvoker);
    context = new ConsensusModule.Context().clusterDir(clusterDir).aeron(aeron).errorCounter(mock(AtomicCounter.class)).ingressChannel("must be specified").replicationChannel("must be specified").moduleStateCounter(mock(Counter.class)).electionStateCounter(mock(Counter.class)).clusterNodeRoleCounter(mock(Counter.class)).commitPositionCounter(mock(Counter.class)).controlToggleCounter(mock(Counter.class)).snapshotCounter(mock(Counter.class)).timedOutClientCounter(mock(Counter.class));
}
Also used : AgentInvoker(org.agrona.concurrent.AgentInvoker) AtomicCounter(org.agrona.concurrent.status.AtomicCounter) Counter(io.aeron.Counter) AtomicCounter(org.agrona.concurrent.status.AtomicCounter) Aeron(io.aeron.Aeron) RethrowingErrorHandler(io.aeron.RethrowingErrorHandler) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with RethrowingErrorHandler

use of io.aeron.RethrowingErrorHandler in project aeron by real-logic.

the class ConsensusModuleContextTest method beforeEach.

@BeforeEach
void beforeEach() {
    final Aeron.Context aeronContext = mock(Aeron.Context.class);
    when(aeronContext.subscriberErrorHandler()).thenReturn(new RethrowingErrorHandler());
    final AgentInvoker conductorInvoker = mock(AgentInvoker.class);
    final Aeron aeron = mock(Aeron.class);
    when(aeron.context()).thenReturn(aeronContext);
    when(aeron.conductorAgentInvoker()).thenReturn(conductorInvoker);
    context = new ConsensusModule.Context().clusterDir(clusterDir).aeron(aeron).errorCounter(mock(AtomicCounter.class)).ingressChannel("must be specified").replicationChannel("must be specified").moduleStateCounter(mock(Counter.class)).electionStateCounter(mock(Counter.class)).clusterNodeRoleCounter(mock(Counter.class)).commitPositionCounter(mock(Counter.class)).controlToggleCounter(mock(Counter.class)).snapshotCounter(mock(Counter.class)).timedOutClientCounter(mock(Counter.class));
}
Also used : AgentInvoker(org.agrona.concurrent.AgentInvoker) AtomicCounter(org.agrona.concurrent.status.AtomicCounter) Counter(io.aeron.Counter) AtomicCounter(org.agrona.concurrent.status.AtomicCounter) Aeron(io.aeron.Aeron) RethrowingErrorHandler(io.aeron.RethrowingErrorHandler) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Aeron (io.aeron.Aeron)2 Counter (io.aeron.Counter)2 RethrowingErrorHandler (io.aeron.RethrowingErrorHandler)2 AgentInvoker (org.agrona.concurrent.AgentInvoker)2 AtomicCounter (org.agrona.concurrent.status.AtomicCounter)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2