org.jivesoftware.smack
Class RosterSmackTest

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.RosterSmackTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
RosterInitializedBeforeConnectTest

public class RosterSmackTest
extends SmackTestCase

Tests the Roster functionality by creating and removing roster entries.

Author:
Gaston Dombiak

Constructor Summary
RosterSmackTest(java.lang.String name)
          Constructor for RosterSmackTest.
 
Method Summary
 void testAddEntryToNewGroup()
          Tests that adding an existing roster entry that belongs to a group to another group works fine.
 void testChangeGroupAndNameToUnfiledEntry()
          1.
 void testChangeNameToUnfiledEntry()
          1.
 void testDeleteAllRosterEntries()
          1.
 void testDeleteAllRosterGroupEntries()
          1.
 void testDeleteAllUnfiledRosterEntries()
          1.
 void testMultipleResources()
          User1 is connected from 2 resources.
 void testNotCommonNickname()
          Tests that the server and Smack are able to handle nicknames that include < > characters.
 void testOfflinePresencesAfterDisconnection()
          Tests the creation of a roster and then simulates abrupt termination.
 void testRenameRosterGroup()
          Test if renaming a roster group works fine.
 void testRosterPresences()
          Test presence management.
 
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

RosterSmackTest

public RosterSmackTest(java.lang.String name)
Constructor for RosterSmackTest.

Parameters:
name -
Method Detail

testDeleteAllRosterGroupEntries

public void testDeleteAllRosterGroupEntries()
1. Create entries in roster groups 2. Iterate on the groups and remove the entry from each group 3. Check that the entries are kept as unfiled entries


testDeleteAllRosterEntries

public void testDeleteAllRosterEntries()
                                throws java.lang.Exception
1. Create entries in roster groups 2. Iterate on all the entries and remove them from the roster 3. Check that the number of entries and groups is zero

Throws:
java.lang.Exception

testDeleteAllUnfiledRosterEntries

public void testDeleteAllUnfiledRosterEntries()
1. Create unfiled entries 2. Iterate on all the entries and remove them from the roster 3. Check that the number of entries and groups is zero


testChangeNameToUnfiledEntry

public void testChangeNameToUnfiledEntry()
1. Create an unfiled entry 2. Change its name 3. Check that the name has been modified 4. Reload the whole roster 5. Check that the name has been modified


testChangeGroupAndNameToUnfiledEntry

public void testChangeGroupAndNameToUnfiledEntry()
1. Create an unfiled entry with no name 2. Check that the the entry does not belong to any group 3. Change its name and add it to a group 4. Check that the name has been modified and that the entry belongs to a group


testAddEntryToNewGroup

public void testAddEntryToNewGroup()
Tests that adding an existing roster entry that belongs to a group to another group works fine.


testRenameRosterGroup

public void testRenameRosterGroup()
Test if renaming a roster group works fine.


testRosterPresences

public void testRosterPresences()
                         throws java.lang.Exception
Test presence management.

1. Log in user0 from a client and user1 from 2 clients 2. Create presence subscription of type BOTH between 2 users 3. Check that presence is correctly delivered to both users 4. User1 logs out from a client 5. Check that presence for each connected resource is correct

Throws:
java.lang.Exception

testMultipleResources

public void testMultipleResources()
                           throws java.lang.Exception
User1 is connected from 2 resources. User1 adds User0 to his roster. Ensure that both resources of user1 get the available presence of User0. Remove User0 from User1's roster and check presences again.

Throws:
java.lang.Exception

testNotCommonNickname

public void testNotCommonNickname()
                           throws java.lang.Exception
Tests that the server and Smack are able to handle nicknames that include < > characters.

Throws:
java.lang.Exception

testOfflinePresencesAfterDisconnection

public void testOfflinePresencesAfterDisconnection()
                                            throws java.lang.Exception
Tests the creation of a roster and then simulates abrupt termination. Cached presences must go offline. At reconnection, presences must go back to online.
  1. Create some entries
  2. Breack the connection
  3. Check offline presences
  4. Whait for automatic reconnection
  5. Check online presences

Throws:
java.lang.Exception