use of abs.backend.java.lib.net.msg.ObjectTargetMsg in project abstools by abstools.
the class NodeImplTest method processObjectTargetMsgNotOnNode.
@Test
public void processObjectTargetMsgNotOnNode() {
ObjectTargetMsg msg = createMock(ObjectTargetMsg.class);
expect(msg.getTarget()).andReturn(object);
expect(currentRouter.getNextNode(msg)).andReturn(otherNode);
expect(arc.getQueue()).andReturn(queue);
queue.enqueue(msg);
expectLastCall();
replay(msg);
replay(currentRouter);
replay(arc);
replay(queue);
currentNode.processMsg(msg);
verify(msg);
verify(currentRouter);
verify(arc);
verify(queue);
}
use of abs.backend.java.lib.net.msg.ObjectTargetMsg in project abstools by abstools.
the class DefaultRouter method getNextNode.
@Override
public NetNode getNextNode(Msg m) {
if (m instanceof ObjectTargetMsg) {
ObjectTargetMsg om = (ObjectTargetMsg) m;
ABSObject target = om.getTarget();
if (routeForObject.containsKey(target)) {
return routeForObject.get(target).getNextNode();
} else {
return node.defaultRoute();
}
} else if (m instanceof ObjectMsg) {
ObjectMsg om = (ObjectMsg) m;
NetCOG target = om.getCOG();
if (routeForCOG.containsKey(target)) {
return routeForCOG.get(target).getNextNode();
} else {
return node.defaultRoute();
}
} else {
return node.defaultRoute();
}
}
Aggregations