use of com.adaptris.core.stubs.MockStandaloneConsumer 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.MockStandaloneConsumer in project interlok by adaptris.
the class ConnectionErrorHandlerTest method testAdaptrisComponentConnectionErrorHandler.
@Test
public void testAdaptrisComponentConnectionErrorHandler() throws Exception {
MockStandaloneConsumer c = new MockStandaloneConsumer(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.MockStandaloneConsumer in project interlok by adaptris.
the class ConnectionErrorHandlerTest method testAdaptrisComponentNullConnectionErrorHandler.
@Test
public void testAdaptrisComponentNullConnectionErrorHandler() throws Exception {
MockStandaloneConsumer c = new MockStandaloneConsumer(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);
}
use of com.adaptris.core.stubs.MockStandaloneConsumer 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