org.jivesoftware.smack
Class MessageTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jivesoftware.smack.test.SmackTestCase
              extended by org.jivesoftware.smack.MessageTest
All Implemented Interfaces:
junit.framework.Test

public class MessageTest
extends SmackTestCase

Tests sending messages to other clients.

Author:
Gaston Dombiak

Constructor Summary
MessageTest(java.lang.String arg0)
           
 
Method Summary
 void testDirectPresence()
          Will a user recieve a message from another after only sending the user a directed presence, or will Wildfire intercept for offline storage? User1 becomes lines.
 void testHighestPriority()
          User0 is connected from 2 resources.
 void testHighestShow()
          User0 is connected from 2 resources.
 void testHugeMessage()
          Check that two clients are able to send messages with a body of 4K characters and their connections are not being closed.
 void testMostRecentActive()
          User0 is connected from 2 resources.
 void testOfflineMessage()
          Check that when a client becomes unavailable all messages sent to the client are stored offline.
 void testOfflineStorageWithNegativePriority()
          User0 is connected from 1 resource with a negative priority presence.
 
Methods inherited from class org.jivesoftware.smack.test.SmackTestCase
assertEquals
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageTest

public MessageTest(java.lang.String arg0)
Method Detail

testDirectPresence

public void testDirectPresence()
Will a user recieve a message from another after only sending the user a directed presence, or will Wildfire intercept for offline storage? User1 becomes lines. User0 never sent an available presence to the server but instead sent one to User1. User1 sends a message to User0. Should User0 get the message?


testOfflineMessage

public void testOfflineMessage()
Check that when a client becomes unavailable all messages sent to the client are stored offline. So that when the client becomes available again the offline messages are received.


testHugeMessage

public void testHugeMessage()
Check that two clients are able to send messages with a body of 4K characters and their connections are not being closed.


testHighestPriority

public void testHighestPriority()
                         throws java.lang.Exception
User0 is connected from 2 resources. User0 is available in both resources but with different priority presence values. User1 sends a message to the bare JID of User0. Check that the resource with highest priority will get the messages.

Throws:
java.lang.Exception - if an error occurs.

testHighestShow

public void testHighestShow()
                     throws java.lang.Exception
User0 is connected from 2 resources. User0 is available in both resources but with different show values. User1 sends a message to the bare JID of User0. Check that the resource with highest show value will get the messages.

Throws:
java.lang.Exception - if an error occurs.

testMostRecentActive

public void testMostRecentActive()
                          throws java.lang.Exception
User0 is connected from 2 resources. User0 is available in both resources with same priority presence values and same show values. User1 sends a message to the bare JID of User0. Check that the resource with most recent activity will get the messages.

Throws:
java.lang.Exception - if an error occurs.

testOfflineStorageWithNegativePriority

public void testOfflineStorageWithNegativePriority()
                                            throws java.lang.Exception
User0 is connected from 1 resource with a negative priority presence. User1 sends a message to the bare JID of User0. Messages should be stored offline. User0 then changes the priority presence to a positive value. Check that offline messages were delivered to the user.

Throws:
java.lang.Exception - if an error occurs.