|
|
|
|
@ -159,7 +159,10 @@ public void testRetrievingServerStoredContactList()
|
|
|
|
|
// the sever creates a group NotInContactList,
|
|
|
|
|
// beacuse the buddy we are sending message to is not in
|
|
|
|
|
// the contactlist. So this group must be ignored
|
|
|
|
|
if(!group.getGroupName().equals("NotInContactList"))
|
|
|
|
|
// Also we must ignore the group created by default
|
|
|
|
|
// from the msn lib
|
|
|
|
|
if(!group.getGroupName().equals("NotInContactList") &&
|
|
|
|
|
!group.getGroupName().equals("Default group"))
|
|
|
|
|
{
|
|
|
|
|
assertNotNull("Group " + group.getGroupName() +
|
|
|
|
|
" was returned by "
|
|
|
|
|
@ -203,11 +206,7 @@ public void postTestCreateGroup()
|
|
|
|
|
// first clear the list
|
|
|
|
|
fixture.clearProvidersLists();
|
|
|
|
|
|
|
|
|
|
Object o = new Object();
|
|
|
|
|
synchronized(o)
|
|
|
|
|
{
|
|
|
|
|
o.wait(3000);
|
|
|
|
|
}
|
|
|
|
|
waitFor(5000);
|
|
|
|
|
|
|
|
|
|
logger.trace("testing creation of server stored groups");
|
|
|
|
|
//first add a listener
|
|
|
|
|
@ -247,7 +246,7 @@ public void postTestCreateGroup()
|
|
|
|
|
{
|
|
|
|
|
opSetPersPresence1.subscribe(group, fixture.userID2);
|
|
|
|
|
|
|
|
|
|
synchronized(o){o.wait(1500);}
|
|
|
|
|
waitFor(1500);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
@ -272,10 +271,10 @@ public void postTestRemoveGroup()
|
|
|
|
|
opSetPersPresence1
|
|
|
|
|
.addServerStoredGroupChangeListener(groupChangeCollector);
|
|
|
|
|
|
|
|
|
|
//create the group
|
|
|
|
|
//remove the group
|
|
|
|
|
opSetPersPresence1.removeServerStoredContactGroup(
|
|
|
|
|
opSetPersPresence1.getServerStoredContactListRoot()
|
|
|
|
|
.getGroup(testGroupName2));
|
|
|
|
|
.getGroup(testGroupName));
|
|
|
|
|
|
|
|
|
|
groupChangeCollector.waitForEvent(10000);
|
|
|
|
|
|
|
|
|
|
@ -286,13 +285,13 @@ public void postTestRemoveGroup()
|
|
|
|
|
assertEquals("Collected Group Change event",
|
|
|
|
|
1, groupChangeCollector.collectedEvents.size());
|
|
|
|
|
|
|
|
|
|
assertEquals("Group name.", testGroupName2,
|
|
|
|
|
assertEquals("Group name.", testGroupName,
|
|
|
|
|
((ServerStoredGroupEvent)groupChangeCollector.collectedEvents
|
|
|
|
|
.get(0)).getSourceGroup().getGroupName());
|
|
|
|
|
|
|
|
|
|
// check whether the group is still on the contact list
|
|
|
|
|
ContactGroup group = opSetPersPresence1.getServerStoredContactListRoot()
|
|
|
|
|
.getGroup(testGroupName2);
|
|
|
|
|
.getGroup(testGroupName);
|
|
|
|
|
|
|
|
|
|
assertNull("A freshly removed group was still on the contact list.",
|
|
|
|
|
group);
|
|
|
|
|
@ -356,11 +355,7 @@ public void prepareContactList()
|
|
|
|
|
{
|
|
|
|
|
fixture.clearProvidersLists();
|
|
|
|
|
|
|
|
|
|
Object o = new Object();
|
|
|
|
|
synchronized(o)
|
|
|
|
|
{
|
|
|
|
|
o.wait(3000);
|
|
|
|
|
}
|
|
|
|
|
waitFor(3000);
|
|
|
|
|
|
|
|
|
|
String contactList = System.getProperty(
|
|
|
|
|
MsnProtocolProviderServiceLick.CONTACT_LIST_PROPERTY_NAME, null);
|
|
|
|
|
@ -420,6 +415,9 @@ public void prepareContactList()
|
|
|
|
|
// now init the list
|
|
|
|
|
Enumeration newGroupsEnum = contactListToCreate.keys();
|
|
|
|
|
|
|
|
|
|
GroupChangeCollector groupChangeCollector = new GroupChangeCollector();
|
|
|
|
|
opSetPersPresence1.addServerStoredGroupChangeListener(groupChangeCollector);
|
|
|
|
|
|
|
|
|
|
//go over all groups in the contactsToAdd table
|
|
|
|
|
while (newGroupsEnum.hasMoreElements())
|
|
|
|
|
{
|
|
|
|
|
@ -429,6 +427,8 @@ public void prepareContactList()
|
|
|
|
|
opSetPersPresence1.createServerStoredContactGroup(
|
|
|
|
|
opSetPersPresence1.getServerStoredContactListRoot(), groupName);
|
|
|
|
|
|
|
|
|
|
groupChangeCollector.waitForEvent(3000);
|
|
|
|
|
|
|
|
|
|
ContactGroup newlyCreatedGroup =
|
|
|
|
|
opSetPersPresence1.getServerStoredContactListRoot().getGroup(groupName);
|
|
|
|
|
|
|
|
|
|
@ -443,10 +443,22 @@ public void prepareContactList()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
waitFor(2000);
|
|
|
|
|
|
|
|
|
|
//store the created contact list for later reference
|
|
|
|
|
MsnSlickFixture.preInstalledBuddyList = contactListToCreate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void waitFor(long time)
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
Object o = new Object();
|
|
|
|
|
synchronized(o)
|
|
|
|
|
{
|
|
|
|
|
o.wait(time);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The class would listen for and store received events delivered to
|
|
|
|
|
* <tt>ServerStoredGroupListener</tt>s.
|
|
|
|
|
@ -677,6 +689,5 @@ public void contactModified(ContactPropertyChangeEvent evt)
|
|
|
|
|
notifyAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|