@ContinuousIntegrationTest(estimatedDuration = 0.5) @Test(timeout = 30000) public void testDoubleForwarder() throws IOException { connectCommunicators(); networkProcessor.setPacketRedirects(TestPacketDestinations.A, TestPacketDestinations.B); boolean threwException = false; try { networkProcessor.setPacketRedirects(TestPacketDestinations.B, TestPacketDestinations.C); } catch(IllegalArgumentException e) { threwException = true; } disconnectCommunicators(); assertTrue(threwException); }
public UiPacketToRosMsgRedirector(DRCRobotModel robotModel, URI rosCoreURI, PacketCommunicator rosAPI_communicator, PacketRouter<PacketDestination> packetRouter, String namespace) { ROS_NAMESPACE = namespace; rosMainNode = new RosMainNode(rosCoreURI, ROS_NAMESPACE, true); this.nodeConfiguration = NodeConfiguration.newPrivate(); this.messageFactory = nodeConfiguration.getTopicMessageFactory(); this.publishers = new ArrayList<RosTopicPublisher<?>>(); packetRouter.setPacketRedirects(PacketDestination.CONTROLLER, PacketDestination.ROS_API); setupMsgTopics(rosAPI_communicator); rosMainNode.execute(); // rosAPI_communicator.attachGlobalListener(this); }
public UiPacketToRosMsgRedirector(DRCRobotModel robotModel, URI rosCoreURI, PacketCommunicator rosAPI_communicator, PacketRouter<PacketDestination> packetRouter, String namespace) { ROS_NAMESPACE = namespace; rosMainNode = new RosMainNode(rosCoreURI, ROS_NAMESPACE, true); this.nodeConfiguration = NodeConfiguration.newPrivate(); this.messageFactory = nodeConfiguration.getTopicMessageFactory(); this.publishers = new ArrayList<RosTopicPublisher<?>>(); packetRouter.setPacketRedirects(PacketDestination.CONTROLLER, PacketDestination.ROS_API); setupMsgTopics(rosAPI_communicator); rosMainNode.execute(); // rosAPI_communicator.attachGlobalListener(this); }
public UiPacketToRosMsgRedirector(DRCRobotModel robotModel, URI rosCoreURI, PacketCommunicator rosAPI_communicator, PacketRouter<PacketDestination> packetRouter, String namespace) { ROS_NAMESPACE = namespace; rosMainNode = new RosMainNode(rosCoreURI, ROS_NAMESPACE, true); this.nodeConfiguration = NodeConfiguration.newPrivate(); this.messageFactory = nodeConfiguration.getTopicMessageFactory(); this.publishers = new ArrayList<RosTopicPublisher<?>>(); packetRouter.setPacketRedirects(PacketDestination.CONTROLLER, PacketDestination.ROS_API); setupMsgTopics(rosAPI_communicator); rosMainNode.execute(); // rosAPI_communicator.attachGlobalListener(this); }
@ContinuousIntegrationTest(estimatedDuration = 0.6) @Test(timeout = 30000) public void testForwarder() throws IOException { connectCommunicators(); networkProcessor.setPacketRedirects(TestPacketDestinations.A, TestPacketDestinations.B); networkProcessor.setPacketRedirects(TestPacketDestinations.E, TestPacketDestinations.C); ArrayList<Packet<?>> packetsForA = createRandomPackets(TestPacketDestinations.A); ArrayList<Packet<?>> packetsForE = createRandomPackets(TestPacketDestinations.E); ArrayList<ConcurrentPacketQueue<?>> consumersForB = createConsumers(packetsForA, packetCommunicatorBServer); ArrayList<ConcurrentPacketQueue<?>> consumersForA = createConsumers(packetsForA, packetCommunicatorAServer); ArrayList<ConcurrentPacketQueue<?>> consumersForC = createConsumers(packetsForE, packetCommunicatorCServer); ArrayList<ConcurrentPacketQueue<?>> consumersForE = createConsumers(packetsForE, packetCommunicatorEServer); sendPackets(packetCommunicatorCServer, packetsForA); sendPackets(packetCommunicatorDServer, packetsForE); assertFalse(checkIfPacketsGoThroughTheWire(packetsForA, consumersForA)); assertFalse(checkIfPacketsGoThroughTheWire(packetsForE, consumersForE)); assertTrue(checkIfPacketsGoThroughTheWire(packetsForA, consumersForB)); assertTrue(checkIfPacketsGoThroughTheWire(packetsForE, consumersForC)); disconnectCommunicators(); }