use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class InitialisedStateTest method testInitialised_To_Started.
@Test
public void testInitialised_To_Started() throws Exception {
MockConnection component = new MockConnection();
component.requestInit();
InitialisedState state = InitialisedState.getInstance();
state.requestStart(component);
assertEquals(StartedState.getInstance(), component.retrieveComponentState());
assertEquals(1, component.getInitCount());
assertEquals(1, component.getStartCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class AdaptrisConnectionTest method testCloneForTesting.
@Test
public void testCloneForTesting() throws Exception {
MockConnection mc = new MockConnection();
assertEquals(MockConnection.class, mc.cloneForTesting().getClass());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class ClosedStateTest method testClosed_To_Stopped.
@Test
public void testClosed_To_Stopped() throws Exception {
MockConnection channel = new MockConnection();
ClosedState state = ClosedState.getInstance();
state.requestStop(channel);
// This actually should do nothing.
assertEquals(ClosedState.getInstance(), channel.retrieveComponentState());
assertEquals(0, channel.getInitCount());
assertEquals(0, channel.getStartCount());
assertEquals(0, channel.getStopCount());
assertEquals(0, channel.getCloseCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class ClosedStateTest method testClosed_To_Initialised.
@Test
public void testClosed_To_Initialised() throws Exception {
MockConnection channel = new MockConnection();
ClosedState state = ClosedState.getInstance();
state.requestInit(channel);
assertEquals(InitialisedState.getInstance(), channel.retrieveComponentState());
assertEquals(1, channel.getInitCount());
assertEquals(0, channel.getStartCount());
assertEquals(0, channel.getStopCount());
assertEquals(0, channel.getCloseCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class ClosedStateTest method testClosed_To_Started.
@Test
public void testClosed_To_Started() throws Exception {
MockConnection channel = new MockConnection();
ClosedState state = ClosedState.getInstance();
state.requestStart(channel);
assertEquals(StartedState.getInstance(), channel.retrieveComponentState());
assertEquals(1, channel.getInitCount());
assertEquals(1, channel.getStartCount());
assertEquals(0, channel.getStopCount());
assertEquals(0, channel.getCloseCount());
}
Aggregations