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

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

        final Queue<DataPacket> serverQueue = s.getListenerRegistrator().createClientMessageQueue(c.getLocalID());
        final Queue<DataPacket> clientQueue = c.getListenerRegistrator().createClientMessageQueue(s.getId());

        final String header = "abcdefg";
        final Message m = new Message(header, "data");

        try {
            assertEquals(GenericResponses.NOT_HANDLED_DIRECTLY, c.sendDataToServer(m));
            assertEquals(GenericResponses.NOT_HANDLED_DIRECTLY, c.sendDataToServer(header));
            assertEquals(2, serverQueue.size());
            DataPacket dp = serverQueue.poll();
            if (dp.getData() instanceof Message) {
                assertEquals(m, dp.getData());
            } else {
                fail("Illegal data inside data packet.");
            }
            dp = serverQueue.poll();
            assertEquals(header, dp.getData());

            assertEquals(GenericResponses.NOT_HANDLED_DIRECTLY, s.getClient(c.getLocalID()).sendData(m));
            assertEquals(GenericResponses.NOT_HANDLED_DIRECTLY, s.getClient(c.getLocalID()).sendData(header));
            assertEquals(2, clientQueue.size());
            dp = clientQueue.poll();
            if (dp.getData() instanceof Message) {
                assertEquals(m, dp.getData());
            } else {
                fail("Illegal data inside data packet.");
            }
            dp = clientQueue.poll();
            assertEquals(header, dp.getData());
        } catch (ConnectionException ex) {
            fail("Communication failed - " + ex);
        }

        c.getListenerRegistrator().removeClientListener(s.getId());
        try {
            assertEquals(GenericResponses.NOT_HANDLED, s.getClient(c.getLocalID()).sendData(m));
        } catch (ConnectionException ex) {
            Logger.getLogger(MessagingTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }