Skip to content
Snippets Groups Projects
Commit 607ecad3 authored by Ernesto Corbellini's avatar Ernesto Corbellini
Browse files

Added test for a skipped state case.

parent 3f87a95d
No related branches found
No related tags found
No related merge requests found
...@@ -6,11 +6,11 @@ import actionlib_msgs.GoalStatus; ...@@ -6,11 +6,11 @@ import actionlib_msgs.GoalStatus;
public class TestClientStateMachine { public class TestClientStateMachine {
@Test @Test
public void test() { public void test1() {
// test a full branch transition from goal ack to waiting for result
int state; int state;
ClientStateMachine stateMachine = new ClientStateMachine(); ClientStateMachine stateMachine = new ClientStateMachine();
//
// set initial state // set initial state
stateMachine.setState(ClientStateMachine.ClientStates.WAITING_FOR_GOAL_ACK); stateMachine.setState(ClientStateMachine.ClientStates.WAITING_FOR_GOAL_ACK);
// transition to next states // transition to next states
...@@ -21,4 +21,17 @@ public class TestClientStateMachine { ...@@ -21,4 +21,17 @@ public class TestClientStateMachine {
stateMachine.transition(actionlib_msgs.GoalStatus.SUCCEEDED); stateMachine.transition(actionlib_msgs.GoalStatus.SUCCEEDED);
assertEquals(ClientStateMachine.ClientStates.WAITING_FOR_RESULT, stateMachine.getState()); assertEquals(ClientStateMachine.ClientStates.WAITING_FOR_RESULT, stateMachine.getState());
} }
@Test
public void test2() {
// test a vector of states transition for a skipped test
int state;
ClientStateMachine stateMachine = new ClientStateMachine();
// set initial state
stateMachine.setState(ClientStateMachine.ClientStates.WAITING_FOR_CANCEL_ACK);
// transition to next states
stateMachine.transition(actionlib_msgs.GoalStatus.RECALLED);
assertEquals(ClientStateMachine.ClientStates.WAITING_FOR_RESULT, stateMachine.getState());
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment