@Test
    public void testRegistration() {
        System.out.println("testRegistration");

        try {
            assertTrue(c.registerToServer(GlobalConstants.IP_LOOPBACK));
        } catch (Exception ex) {
            fail("Registration from client to server failed - " + ex);
        }

        try {
            c.deregisterFromServer();
        } catch (ConnectionException ex) {
            fail("Client deregistration failed.");
        }

        try {
            assertNotNull(s.getClientManager().registerClient(GlobalConstants.IP_LOOPBACK, PORT_CLIENT));
        } catch (IllegalArgumentException ex) {
            fail("Registration from server to client failed - " + ex);
        } catch (ConnectionException ex) {
            fail("Registration from server to client failed - " + ex);
        }

        try {
            CommunicatorInner comm = (CommunicatorInner) CommunicatorImpl.initNewCommunicator(GlobalConstants.IP_LOOPBACK, 5252, UUID.randomUUID());
            comm.setTargetId(s.getId());            
            comm.sendData("data");
            fail("Should have failed, because this communicator is not registered.");
        } catch (ConnectionException ex) {
            assertEquals(ConnectionExceptionCause.UUID_NOT_ALLOWED, ex.getExceptionCause());
        } catch (IllegalArgumentException ex) {
            fail(ex.getLocalizedMessage());
        }
    }