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

Now the fibonacci test sends the result with the correct info.

parent 9266e665
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ public class TestServer extends AbstractNodeMain implements ActionServerListener
@Override
public void onStart(ConnectedNode node) {
FibonacciActionResult result;
String id;
as = new ActionServer<FibonacciActionGoal, FibonacciActionFeedback,
FibonacciActionResult>(node, "/fibonacci", FibonacciActionGoal._TYPE,
......@@ -38,7 +39,10 @@ public class TestServer extends AbstractNodeMain implements ActionServerListener
if (currentGoal != null) {
result = as.newResultMessage();
result.getResult().setSequence(fibonacciSequence(currentGoal.getGoal().getOrder()));
as.setSucceed(currentGoal.getGoalId().getId());
id = currentGoal.getGoalId().getId();
as.setSucceed(id);
as.setGoalStatus(result.getStatus(), id);
System.out.println("Sending result...");
as.sendResult(result);
currentGoal = null;
}
......@@ -48,9 +52,6 @@ public class TestServer extends AbstractNodeMain implements ActionServerListener
@Override
public void goalReceived(FibonacciActionGoal goal) {
System.out.println("Goal received.");
sleep(2000);
System.out.println("Sending result...");
sleep(2000);as.sendResult(as.newResultMessage());
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment