use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class StartedStateTest method testRestart.
@Test
public void testRestart() throws Exception {
MockConnection component = new MockConnection();
component.requestStart();
StartedState state = StartedState.getInstance();
state.requestRestart(component);
assertEquals(StartedState.getInstance(), component.retrieveComponentState());
assertEquals(2, component.getInitCount());
assertEquals(2, component.getStartCount());
assertEquals(1, component.getStopCount());
assertEquals(1, component.getCloseCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class StartedStateTest method testStarted_To_Stopped.
@Test
public void testStarted_To_Stopped() throws Exception {
MockConnection component = new MockConnection();
component.requestStart();
StartedState state = StartedState.getInstance();
state.requestStop(component);
assertEquals(StoppedState.getInstance(), component.retrieveComponentState());
assertEquals(1, component.getInitCount());
assertEquals(1, component.getStartCount());
assertEquals(1, component.getStopCount());
assertEquals(0, component.getCloseCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class StoppedStateTest method testStopped_To_Initialised.
@Test
public void testStopped_To_Initialised() throws Exception {
MockConnection component = new MockConnection();
component.requestStart();
component.requestStop();
StoppedState state = StoppedState.getInstance();
state.requestInit(component);
// redmineID #4453 - Stopped won't let you goto Initialised.
assertEquals(StoppedState.getInstance(), component.retrieveComponentState());
assertEquals(1, component.getInitCount());
assertEquals(1, component.getStartCount());
assertEquals(1, component.getStopCount());
assertEquals(0, component.getCloseCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class StoppedStateTest method testStopped_To_Stopped.
@Test
public void testStopped_To_Stopped() throws Exception {
MockConnection component = new MockConnection();
component.requestStart();
component.requestStop();
StoppedState state = StoppedState.getInstance();
state.requestStop(component);
assertEquals(StoppedState.getInstance(), component.retrieveComponentState());
assertEquals(1, component.getInitCount());
assertEquals(1, component.getStartCount());
assertEquals(1, component.getStopCount());
assertEquals(0, component.getCloseCount());
}
use of com.adaptris.core.stubs.MockConnection in project interlok by adaptris.
the class StoppedStateTest method testStopped_To_Closed.
@Test
public void testStopped_To_Closed() throws Exception {
MockConnection component = new MockConnection();
component.requestStart();
component.requestStop();
StoppedState state = StoppedState.getInstance();
state.requestClose(component);
assertEquals(ClosedState.getInstance(), component.retrieveComponentState());
assertEquals(1, component.getInitCount());
assertEquals(1, component.getStartCount());
assertEquals(1, component.getStopCount());
assertEquals(1, component.getCloseCount());
}
Aggregations