diff options
author | Emil Ivov <emcho@jitsi.org> | 2007-09-14 16:35:39 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2007-09-14 16:35:39 +0000 |
commit | d40aad586268e28d8b79209b6bd0ab884c63c109 (patch) | |
tree | c844eae26e3a971111f29e93f8864b1563774e62 /test | |
parent | 6e7d34b91c73e5155e4195f662834fbe114fe4cd (diff) | |
download | jitsi-d40aad586268e28d8b79209b6bd0ab884c63c109.zip jitsi-d40aad586268e28d8b79209b6bd0ab884c63c109.tar.gz jitsi-d40aad586268e28d8b79209b6bd0ab884c63c109.tar.bz2 |
Fixing a long standing problem with the meta contact list tests. The meta contact list tests are enabled again.
Diffstat (limited to 'test')
-rw-r--r-- | test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java | 7 | ||||
-rw-r--r-- | test/net/java/sip/communicator/slick/contactlist/TestMetaContactList.java | 18 |
2 files changed, 12 insertions, 13 deletions
diff --git a/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java b/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java index ae60180..7c8b5bd 100644 --- a/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java +++ b/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java @@ -185,10 +185,17 @@ public class MetaContactListServiceLick root.addContact( new MockContact("Martin Dupont", provider) ); root.addContact( new MockContact("Joe Bloggs", provider) ); + MockContact someOfflineContact + = new MockContact("I am offline", provider); + someOfflineContact.setPresenceStatus(MockStatusEnum.MOCK_STATUS_00); + root.addContact( someOfflineContact); + mockContactToRename = new MockContact("Jane Doe", provider) ; root.addContact( mockContactToRename ); mockContactToReorder = new MockContact("ZI'llChangeMyStatus", provider); + //make sure that the contact starts at the bottom of the list. + mockContactToReorder.setPresenceStatus(MockStatusEnum.MOCK_STATUS_00); root.addContact(mockContactToReorder); topLevelMockGroup = new MockContactGroup(topLevelGroupName, provider); diff --git a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactList.java b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactList.java index 64a866a..2f508df 100644 --- a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactList.java +++ b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactList.java @@ -134,7 +134,7 @@ public class TestMetaContactList fixture.metaClService.removeMetaContactListListener(evtCollector); - //check whether a reordered event is dispatchect + //make sure that the order didn't change assertEquals("Number of evts dispatched after a contact changed its status" , 1 , evtCollector.collectedMetaContactGroupEvents.size()); @@ -149,16 +149,6 @@ public class TestMetaContactList , fixture.metaClService.getRoot() , evt.getSourceMetaContactGroup()); - //then check wether the contact is has been moved to the top of the list - MetaContact theReorderedContact - = fixture.metaClService.getRoot().getMetaContact(0); - assertEquals(MetaContactListServiceLick.mockContactToReorder - + " was not moved to the top of the list after being " - +"assigned the highest possible presence status" - , MetaContactListServiceLick.mockContactToReorder - .getDisplayName() - , theReorderedContact.getDisplayName()); - //then check the general order assertContactsOrder(fixture.metaClService.getRoot()); @@ -172,6 +162,8 @@ public class TestMetaContactList //repeat order tests but this time after changing the display name of a //contact. fixture.metaClService.addMetaContactListListener(evtCollector); + MetaContact theReorderedContact = fixture.metaClService + .findMetaContactByContact(MetaContactListServiceLick.mockContactToReorder); fixture.metaClService.renameMetaContact(theReorderedContact, "zzzzzz"); fixture.metaClService.removeMetaContactListListener(evtCollector); @@ -192,10 +184,10 @@ public class TestMetaContactList , fixture.metaClService.getRoot() , evt.getSourceMetaContactGroup()); - //then check wether the contact is has been moved to the top of the list + //then check wether the contact is has been moved to the bottom of the list assertSame(MetaContactListServiceLick.mockContactToReorder + " was not moved to the bottom of the list after being " - +"assigned an equal to all status and a heavy name." + +"assigned 00 status and a heavy name." , theReorderedContact , fixture.metaClService.getRoot().getMetaContact( fixture.metaClService.getRoot().countChildContacts()-1)); |