@ContinuousIntegrationTest(estimatedDuration = 0.7)
@Test(timeout = 30000)
public void testDetatchObjectCommunicator() throws IOException
{
connectCommunicators();
ArrayList<Packet<?>> packetsForA = createRandomPackets(TestPacketDestinations.A);
ArrayList<Packet<?>> packetsForB = createRandomPackets(TestPacketDestinations.B);
ArrayList<Packet<?>> packetsForE = createRandomPackets(TestPacketDestinations.E);
ArrayList<ConcurrentPacketQueue<?>> consumersForA = createConsumers(packetsForA, packetCommunicatorAServer);
ArrayList<ConcurrentPacketQueue<?>> consumersForB = createConsumers(packetsForB, packetCommunicatorBServer);
ArrayList<ConcurrentPacketQueue<?>> consumersForE = createConsumers(packetsForE, packetCommunicatorEServer);
sendPackets(packetCommunicatorAServer, packetsForB);
assertTrue(checkIfPacketsGoThroughTheWire(packetsForB, consumersForB));
networkProcessor.detatchObjectCommunicator(TestPacketDestinations.B);
sendPackets(packetCommunicatorAServer, packetsForB);
sendPackets(packetCommunicatorBServer, packetsForA);
assertFalse(checkIfPacketsGoThroughTheWire(packetsForB, consumersForB));
assertFalse(checkIfPacketsGoThroughTheWire(packetsForA, consumersForA));
sendPackets(packetCommunicatorAServer, packetsForE);
assertTrue(checkIfPacketsGoThroughTheWire(packetsForE, consumersForE));
networkProcessor.detatchObjectCommunicator(TestPacketDestinations.E);
sendPackets(packetCommunicatorAServer, packetsForE);
sendPackets(packetCommunicatorEServer, packetsForA);
assertFalse(checkIfPacketsGoThroughTheWire(packetsForE, consumersForE));
assertFalse(checkIfPacketsGoThroughTheWire(packetsForA, consumersForA));
disconnectCommunicators();
}