test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java
/**
     * Creates an Message through the advance createMessage() method and
     * inspects its parameters.
     */
Creates an Message through the advance createMessage() method and
inspects its parameters.
Creates an Message through the advance createMessage () method and inspects its parameters .
public void testCreateMessage2()
        throws UnsupportedEncodingException
    {
        String body = "This is an IM coming from the tested implementation"
            + " on " + new Date().toString();
        String contentType = "text/html";
        String encoding = "UTF-16";
        String subject = "test message";
        net.java.sip.communicator.service.protocol.Message msg =
            opSetBasicIM1.createMessage(body, contentType, encoding, subject);
        byte[] bodyBytes = body.getBytes(encoding);
        assertEquals("message body", body, msg.getContent());
        assertTrue("message body bytes"
                   , Arrays.equals(bodyBytes, msg.getRawData()));
        assertEquals("message length", bodyBytes.length, msg.getSize());
        assertEquals("message content type", contentType, msg.getContentType());
        assertEquals("message encoding", encoding, msg.getEncoding());
        assertNotNull("message uid", msg.getMessageUID());
        net.java.sip.communicator.service.protocol.Message msg2
            = opSetBasicIM1.createMessage(body);
        assertFalse("message uid", msg.getMessageUID().equals(
            msg2.getMessageUID()));
    }
public void testCreateMessage2 ( ) throws UnsupportedEncodingException { String body = "This is an IM coming from the tested implementation" + " on " + new Date ( ) . toString ( ) ; String contentType = "text/html" ; String encoding = "UTF-16" ; String subject = "test message" ; net . java . sip . communicator . service . protocol . Message msg = opSetBasicIM1 . createMessage ( body , contentType , encoding , subject ) ; byte [ ] bodyBytes = body . getBytes ( encoding ) ; assertEquals ( "message body" , body , msg . getContent ( ) ) ; assertTrue ( "message body bytes" , Arrays . equals ( bodyBytes , msg . getRawData ( ) ) ) ; assertEquals ( "message length" , bodyBytes . length , msg . getSize ( ) ) ; assertEquals ( "message content type" , contentType , msg . getContentType ( ) ) ; assertEquals ( "message encoding" , encoding , msg . getEncoding ( ) ) ; assertNotNull ( "message uid" , msg . getMessageUID ( ) ) ; net . java . sip . communicator . service . protocol . Message msg2 = opSetBasicIM1 . createMessage ( body ) ; assertFalse ( "message uid" , msg . getMessageUID ( ) . equals ( msg2 . getMessageUID ( ) ) ) ; }
Creates an Message through the advance createMessage() method and
 inspects its parameters.
Creates an Message through the advance createMessage () method and inspects its parameters .
//a further test on message uid.