Node n3 = g.getNode("3");
assertNotNull(n3);
// Try a message, where a phantom actor is missing
ActorMove[] moves = new ActorMove[] {
new ActorMove(batman, n1, null)
};
MessageMove msg = new MessageMove(moves);
try {
g.verifyActorPlacement(msg, detectiveClient);
fail("Message validation failed - not all actors were placed");
}
catch(ProtocolException e) {
}
// Try a message, where one actor is placed multiple times
moves = new ActorMove[] {
new ActorMove(batman, n1, null),
new ActorMove(poirot, n2, null),
new ActorMove(batman, n3, null)
};
msg = new MessageMove(moves);
try {
g.verifyActorPlacement(msg, detectiveClient);
fail("Message validation failed - an actor was placed multiple times");
}
catch(ProtocolException e) {
}
// Try a message, where the transport type is specified for some
// of the actors
moves = new ActorMove[] {
new ActorMove(batman, n1, tram),
new ActorMove(poirot, n2, null)
};
msg = new MessageMove(moves);
try {
g.verifyActorPlacement(msg, detectiveClient);
fail("Message validation failed - transport type was specified for an actor");
}
catch(ProtocolException e) {
}
// Try a message, where the target node is missing for some of
// the actors.
moves = new ActorMove[] {
new ActorMove(batman, null, tram),
new ActorMove(poirot, n2, null),
};
msg = new MessageMove(moves);
try {
g.verifyActorPlacement(msg, detectiveClient);
fail("Message validation failed - target node was not specified for an actor");
}
catch(ProtocolException e) {
}
// Try a message, where a detective actor is placed
moves = new ActorMove[] {
new ActorMove(poirot, n1, null),
new ActorMove(joker, n2, null),
new ActorMove(batman, n3, null)
};
msg = new MessageMove(moves);
try {
g.verifyActorPlacement(msg, detectiveClient);
fail("Message validation failed - an actor of the other player was placed");
}
catch(ProtocolException e) {
}
// Try a message, where two actors are placed at the same node
moves = new ActorMove[] {
new ActorMove(batman, n1, null),
new ActorMove(poirot, n1, null)
};
msg = new MessageMove(moves);
try {
g.verifyActorPlacement(msg, detectiveClient);
fail("Message validation failed - two actors were placed at the same position");