use of com.adaptris.core.stubs.StateManagedStandaloneConsumer in project interlok by adaptris.
the class ConnectionErrorHandlerTest method testStateManagedComponentConnectionErrorHandler.
@Test
public void testStateManagedComponentConnectionErrorHandler() throws Exception {
MockStandaloneConsumer c = new StateManagedStandaloneConsumer(new TriggeredFailingConnection(), new MockMessageConsumer(new MockMessageListener()));
start(c);
((TriggeredFailingConnection) c.getConnection()).triggerError();
assertEquals(2, c.getInitCount());
assertEquals(2, c.getStartCount());
assertEquals(1, c.getStopCount());
assertEquals(1, c.getCloseCount());
stop(c);
}
use of com.adaptris.core.stubs.StateManagedStandaloneConsumer in project interlok by adaptris.
the class ConnectionErrorHandlerTest method testStateManagedComponentNullConnectionErrorHandler.
@Test
public void testStateManagedComponentNullConnectionErrorHandler() throws Exception {
MockStandaloneConsumer c = new StateManagedStandaloneConsumer(new TriggeredFailingConnection(new NullConnectionErrorHandler()), new MockMessageConsumer(new MockMessageListener()));
start(c);
((TriggeredFailingConnection) c.getConnection()).triggerError();
assertEquals(1, c.getInitCount());
assertEquals(1, c.getStartCount());
assertEquals(0, c.getStopCount());
assertEquals(0, c.getCloseCount());
stop(c);
}
Aggregations