org.jivesoftware.smack
Class RosterTest

java.lang.Object
  extended by org.jivesoftware.smack.RosterTest

public class RosterTest
extends java.lang.Object

Tests that verifies the correct behavior of the Roster implementation.

Author:
Guenther Niess
See Also:
Roster, Roster Management

Nested Class Summary
static class RosterTest.TestRosterListener
          This class can be used to check if the RosterListener was invoked.
 
Constructor Summary
RosterTest()
           
 
Method Summary
static void initRoster(DummyConnection connection, Roster roster)
          Initialize the roster according to the example in RFC3921: Retrieving One's Roster on Login.
static void removeAllRosterEntries(DummyConnection connection, Roster roster)
          Remove all roster entries by iterating trough Roster.getEntries() and simulating receiving roster pushes from the server.
 void setUp()
           
 void tearDown()
           
 void testAddEmptyGroupEntry()
          Test if adding an user with an empty group is equivalent with providing no group.
 void testAddRosterItem()
          Test adding a roster item according to the example in RFC3921: Adding a Roster Item.
 void testDeleteRosterItem()
          Test deleting a roster item according to the example in RFC3921: Deleting a Roster Item.
 void testEmptyGroupRosterPush()
          Test processing a roster push with an empty group is equivalent with providing no group.
 void testSimpleRosterInitialization()
          Test a simple roster initialization according to the example in RFC3921: Retrieving One's Roster on Login.
 void testSimpleRosterPush()
          Test a simple roster push according to the example in RFC3921bis-03: Roster Push.
 void testUpdateRosterItem()
          Test updating a roster item according to the example in RFC3921: Updating a Roster Item.
static void verifyBenvoliosEntry(RosterEntry benvolio)
          Check Benvolio's roster entry according to the example in RFC3921: Retrieving One's Roster on Login.
static void verifyMercutiosEntry(RosterEntry mercutio)
          Check Mercutio's roster entry according to the example in RFC3921: Retrieving One's Roster on Login.
static void verifyRomeosEntry(RosterEntry romeo)
          Check Romeo's roster entry according to the example in RFC3921: Retrieving One's Roster on Login.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RosterTest

public RosterTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

public void tearDown()
              throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleRosterInitialization

public void testSimpleRosterInitialization()
                                    throws java.lang.Exception
Test a simple roster initialization according to the example in RFC3921: Retrieving One's Roster on Login.

Throws:
java.lang.Exception

testAddRosterItem

public void testAddRosterItem()
                       throws java.lang.Throwable
Test adding a roster item according to the example in RFC3921: Adding a Roster Item.

Throws:
java.lang.Throwable

testUpdateRosterItem

public void testUpdateRosterItem()
                          throws java.lang.Throwable
Test updating a roster item according to the example in RFC3921: Updating a Roster Item.

Throws:
java.lang.Throwable

testDeleteRosterItem

public void testDeleteRosterItem()
                          throws java.lang.Throwable
Test deleting a roster item according to the example in RFC3921: Deleting a Roster Item.

Throws:
java.lang.Throwable

testSimpleRosterPush

public void testSimpleRosterPush()
                          throws java.lang.Throwable
Test a simple roster push according to the example in RFC3921bis-03: Roster Push.

Throws:
java.lang.Throwable

testAddEmptyGroupEntry

public void testAddEmptyGroupEntry()
                            throws java.lang.Throwable
Test if adding an user with an empty group is equivalent with providing no group.

Throws:
java.lang.Throwable
See Also:
SMACK-294

testEmptyGroupRosterPush

public void testEmptyGroupRosterPush()
                              throws java.lang.Throwable
Test processing a roster push with an empty group is equivalent with providing no group.

Throws:
java.lang.Throwable
See Also:
SMACK-294

removeAllRosterEntries

public static void removeAllRosterEntries(DummyConnection connection,
                                          Roster roster)
                                   throws java.lang.InterruptedException,
                                          XMPPException
Remove all roster entries by iterating trough Roster.getEntries() and simulating receiving roster pushes from the server.

Parameters:
connection - the dummy connection of which the provided roster belongs to.
roster - the roster (or buddy list) which should be initialized.
Throws:
java.lang.InterruptedException
XMPPException

initRoster

public static void initRoster(DummyConnection connection,
                              Roster roster)
                       throws java.lang.InterruptedException,
                              XMPPException
Initialize the roster according to the example in RFC3921: Retrieving One's Roster on Login.

Parameters:
connection - the dummy connection of which the provided roster belongs to.
roster - the roster (or buddy list) which should be initialized.
Throws:
java.lang.InterruptedException
XMPPException

verifyRomeosEntry

public static void verifyRomeosEntry(RosterEntry romeo)
Check Romeo's roster entry according to the example in RFC3921: Retrieving One's Roster on Login.

Parameters:
romeo - the roster entry which should be verified.

verifyMercutiosEntry

public static void verifyMercutiosEntry(RosterEntry mercutio)
Check Mercutio's roster entry according to the example in RFC3921: Retrieving One's Roster on Login.

Parameters:
mercutio - the roster entry which should be verified.

verifyBenvoliosEntry

public static void verifyBenvoliosEntry(RosterEntry benvolio)
Check Benvolio's roster entry according to the example in RFC3921: Retrieving One's Roster on Login.

Parameters:
benvolio - the roster entry which should be verified.