test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java
/**
     * Send an instant message from the tested operation set and assert
     * reception by the icq tester agent.
     */
Send an instant message from the tested operation set and assert
reception by the icq tester agent.
Send an instant message from the tested operation set and assert reception by the icq tester agent .
public void firstTestReceiveMessage()
    {
        String body = "This is an IM coming from the tester agent"
            + " on " + new Date().toString();
        ImEventCollector evtCollector = new ImEventCollector();
        opSetBasicIM.addMessageListener(evtCollector);
        IcqSlickFixture.testerAgent.sendMessage(fixture.ourUserID, body);
        evtCollector.waitForEvent(10000);
        opSetBasicIM.removeMessageListener(evtCollector);
        assertTrue( "No events delivered upon a received message"
                    , evtCollector.collectedEvents.size() > 0);
        assertTrue( "Received evt was not an instance of "
                    + MessageReceivedEvent.class.getName()
                    , evtCollector.collectedEvents.get(0)
                                instanceof MessageReceivedEvent);
        MessageReceivedEvent evt
            = (MessageReceivedEvent)evtCollector.collectedEvents.get(0);
        assertEquals("message sender "
                     , evt.getSourceContact().getAddress()
                     , IcqSlickFixture.testerAgent.getIcqUIN());
        assertEquals("message body", body, evt.getSourceMessage().getContent());
    }
public void firstTestReceiveMessage ( ) { String body = "This is an IM coming from the tester agent" + " on " + new Date ( ) . toString ( ) ; ImEventCollector evtCollector = new ImEventCollector ( ) ; opSetBasicIM . addMessageListener ( evtCollector ) ; IcqSlickFixture . testerAgent . sendMessage ( fixture . ourUserID , body ) ; evtCollector . waitForEvent ( 10000 ) ; opSetBasicIM . removeMessageListener ( evtCollector ) ; assertTrue ( "No events delivered upon a received message" , evtCollector . collectedEvents . size ( ) > 0 ) ; assertTrue ( "Received evt was not an instance of " + MessageReceivedEvent . class . getName ( ) , evtCollector . collectedEvents . get ( 0 ) instanceof MessageReceivedEvent ) ; MessageReceivedEvent evt = ( MessageReceivedEvent ) evtCollector . collectedEvents . get ( 0 ) ; assertEquals ( "message sender " , evt . getSourceContact ( ) . getAddress ( ) , IcqSlickFixture . testerAgent . getIcqUIN ( ) ) ; assertEquals ( "message body" , body , evt . getSourceMessage ( ) . getContent ( ) ) ; }
Send an instant message from the tested operation set and assert
 reception by the icq tester agent.
Send an instant message from the tested operation set and assert reception by the icq tester agent .
//add a msg listener and register to the op set and send an instant //msg from the tester agent. //assert reception of a message event //assert event instance of Message Received Evt //assert source contact == testAgent.uin //assert messageBody == body