mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 14:02:06 +01:00
Adds test cases for renaming roster groups
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2177 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
b194d99054
commit
a4eef67896
1 changed files with 33 additions and 3 deletions
|
@ -218,9 +218,7 @@ public class RosterTest extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Test presence management.
|
||||
*/
|
||||
public void testRosterPresences() {
|
||||
try {
|
||||
|
@ -279,6 +277,38 @@ public class RosterTest extends TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if renaming a roster group works fine.
|
||||
*
|
||||
*/
|
||||
public void testRenameRosterGroup() {
|
||||
try {
|
||||
// Add a new roster entry
|
||||
conn1.getRoster().createEntry("gato11@" + conn1.getHost(), "gato11", new String[] {"Friends"});
|
||||
conn1.getRoster().createEntry("gato12@" + conn1.getHost(), "gato12", new String[] {"Friends"});
|
||||
|
||||
Thread.sleep(200);
|
||||
|
||||
conn1.getRoster().getGroup("Friends").setName("Amigos");
|
||||
Thread.sleep(200);
|
||||
assertNull("The group Friends still exists", conn1.getRoster().getGroup("Friends"));
|
||||
assertNotNull("The group Amigos does not exist", conn1.getRoster().getGroup("Amigos"));
|
||||
assertEquals("Wrong number of entries in the group Amigos ", 2, conn1.getRoster().getGroup("Amigos").getEntryCount());
|
||||
|
||||
|
||||
conn1.getRoster().getGroup("Amigos").setName("");
|
||||
Thread.sleep(200);
|
||||
assertNull("The group Amigos still exists", conn1.getRoster().getGroup("Amigos"));
|
||||
assertNotNull("The group with no name does not exist", conn1.getRoster().getGroup(""));
|
||||
assertEquals("Wrong number of entries in the group \"\" ", 2, conn1.getRoster().getGroup("").getEntryCount());
|
||||
|
||||
cleanUpRoster();
|
||||
}
|
||||
catch (Exception e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up all the entries in the roster
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue