Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rosjava_actionlib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Ebert
rosjava_actionlib
Commits
607ecad3
Commit
607ecad3
authored
9 years ago
by
Ernesto Corbellini
Browse files
Options
Downloads
Patches
Plain Diff
Added test for a skipped state case.
parent
3f87a95d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rosjava_actionlib/rosjava_actionlib/src/test/java/TestClientStateMachine.java
+15
-2
15 additions, 2 deletions
...sjava_actionlib/src/test/java/TestClientStateMachine.java
with
15 additions
and
2 deletions
src/rosjava_actionlib/rosjava_actionlib/src/test/java/TestClientStateMachine.java
+
15
−
2
View file @
607ecad3
...
@@ -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
());
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment