@Test
    public void testRun()
    {
        comm1 = new Communicator(comm1PortNumber);
        comm2 = new Communicator(comm2PortNumber);
        
        //setUpAddresses
        toComm1Address = new InetSocketAddress("127.0.0.1", comm1PortNumber);
        toComm2Address = new InetSocketAddress("127.0.0.1", comm2PortNumber);
        
        //setUpMessages
        toComm1Message = new RegisterRequest(this.playerName);
        toComm2Message = new RegisterRequest(this.playerName);
        
        //addToEnvelopes
        toComm1Envelope = Envelope.createOutgoingEnvelope(toComm1Message, toComm1Address);
        toComm2Envelope = Envelope.createOutgoingEnvelope(toComm2Message, toComm2Address);
        
        if(comm1==null||comm2==null)
        {
            this.getLogger().error("CommunicatorTest testRun:\n\t a comm is null");
            fail();
        }
        if(toComm1Envelope==null||toComm2Envelope==null)
        {
            this.getLogger().error("CommunicatorTest testRun:\n\t an envelope is null");
            fail();
        }
        if(toComm1Envelope.getMessage()==null||toComm2Envelope.getMessage()==null)
        {
            this.getLogger().error("CommunicatorTest testRun:\n\t an envelope's message is null");
            fail();
        }
        
        comm1.start();
        comm2.start();
        
        comm1.addToOutputQueue(toComm2Envelope);
        comm2.addToOutputQueue(toComm1Envelope);
        
        try
        {
            Thread.sleep(500);
        } catch (InterruptedException e)
        {
            this.getLogger().error("CommunicatorTest testRun:\n\t an envelope is null");
            System.out.println("couldn't sleep");
        }
        Envelope received1 = comm2.getFromInputQueue();
        Envelope received2 = comm1.getFromInputQueue();
        if(received1 == null)
        {
            this.getLogger().error("CommunicatorTest testRun:\n\t comm2 received no message from comm1");
            fail();
        }
        if(received2 == null)
        {
            this.getLogger().error("CommunicatorTest testRun:\n\t comm1 received no message from comm2");
            fail();
        }
        RegisterRequest request1 = (RegisterRequest)received1.getMessage();
        RegisterRequest request2 = (RegisterRequest)received1.getMessage();
        
        
        assertEquals(request1.getConversationID().getProcessID(), request2.getConversationID().getProcessID());
        
        assertEquals(request1.getConversationID().getSequenceNumber(), request2.getConversationID().getSequenceNumber());
        
        assertEquals(request1.getMessageID().getProcessID(), request2.getMessageID().getProcessID());
        assertEquals(request1.getMessageID().getSequenceNumber(), request2.getMessageID().getSequenceNumber());
        
        assertEquals(request1.getRequestType(), request2.getRequestType());
        
        assertEquals(request1.getPlayerName(), request2.getPlayerName());
    }