aboutsummaryrefslogtreecommitdiffstats
path: root/test/net/java/sip/communicator/slick/contactlist
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-09 20:45:16 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-09 20:45:16 +0000
commit331d75a93a6f83444b5d295c1697d6e707c19d46 (patch)
treecaee2201bed2c1c616acc70e0b52f5b52a68d23b /test/net/java/sip/communicator/slick/contactlist
parent690b5fa412f7e98f5e5e342d5879aaf4fda02922 (diff)
downloadjitsi-331d75a93a6f83444b5d295c1697d6e707c19d46.zip
jitsi-331d75a93a6f83444b5d295c1697d6e707c19d46.tar.gz
jitsi-331d75a93a6f83444b5d295c1697d6e707c19d46.tar.bz2
Eliminates duplication of ProtocolProviderService.getOperationSet() and .getSupportedOperationSets() for all protocol implementations by moving the implementations into AbstractProtocolProviderService. Uses .getOperationSet() instead of .getSupportedOperationSets() where appropriate in order to produce less garbage (due to Hashtable cloning).
Diffstat (limited to 'test/net/java/sip/communicator/slick/contactlist')
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java14
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java14
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java7
-rw-r--r--test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java48
4 files changed, 38 insertions, 45 deletions
diff --git a/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java b/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java
index 451cc35..a92df3d 100644
--- a/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java
+++ b/test/net/java/sip/communicator/slick/contactlist/MclSlickFixture.java
@@ -118,22 +118,20 @@ public class MclSlickFixture
mockP1Grp1.addContact(emilP1);
mockP1Grp1.addSubgroup(subMockP1Grp);
- mockPresOpSetP1 = (MockPersistentPresenceOperationSet) mockP1
- .getSupportedOperationSets().get(
- OperationSetPresence.class.getName());
+ mockPresOpSetP1 =
+ (MockPersistentPresenceOperationSet) mockP1
+ .getOperationSet(OperationSetPresence.class);
mockPresOpSetP1.addMockGroup(mockP1Grp1);
//init mock provider 2
mockP2Grp1.addContact(emilP2);
- mockPresOpSetP2 = (MockPersistentPresenceOperationSet) mockP2
- .getSupportedOperationSets().get(
- OperationSetPresence.class.getName());
+ mockPresOpSetP2 =
+ (MockPersistentPresenceOperationSet) mockP2
+ .getOperationSet(OperationSetPresence.class);
mockPresOpSetP2.addMockGroup(mockP2Grp1);
}
-
-
public MclSlickFixture(Object obj)
{
}
diff --git a/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java b/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java
index 7c8b5bd..af21999 100644
--- a/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java
+++ b/test/net/java/sip/communicator/slick/contactlist/MetaContactListServiceLick.java
@@ -78,14 +78,11 @@ public class MetaContactListServiceLick
MclSlickFixture.mockProvider = provider;
//store thre presence op set of the new provider into the fixture
- Map supportedOperationSets =
- MclSlickFixture.mockProvider.getSupportedOperationSets();
//get the operation set presence here.
MclSlickFixture.mockPresOpSet =
- (MockPersistentPresenceOperationSet)supportedOperationSets.get(
- OperationSetPersistentPresence.class.getName());
-
+ (MockPersistentPresenceOperationSet) MclSlickFixture.mockProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
//add the meta contact list tests.
addTestSuite(TestMetaContactList.class);
@@ -175,10 +172,9 @@ public class MetaContactListServiceLick
*/
private void fillMockContactList(MockProvider provider)
{
- MockPersistentPresenceOperationSet mockOpSet
- = (MockPersistentPresenceOperationSet)provider.
- getSupportedOperationSets().get( OperationSetPersistentPresence.
- class.getName());
+ MockPersistentPresenceOperationSet mockOpSet =
+ (MockPersistentPresenceOperationSet) provider
+ .getOperationSet(OperationSetPersistentPresence.class);
MockContactGroup root =
(MockContactGroup)mockOpSet.getServerStoredContactListRoot();
root.addContact( new MockContact("Ivan Ivanov", provider) );
diff --git a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java
index 29fbbd2..0d6a863 100644
--- a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java
+++ b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactGroup.java
@@ -45,10 +45,9 @@ public class TestMetaContactGroup extends TestCase
super.setUp();
fixture.setUp();
- OperationSetPersistentPresence opSetPresence
- = (OperationSetPersistentPresence)fixture.mockProvider
- .getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName());
+ OperationSetPersistentPresence opSetPresence =
+ (OperationSetPersistentPresence) fixture.mockProvider
+ .getOperationSet(OperationSetPersistentPresence.class);
mockGroup = (MockContactGroup)opSetPresence
.getServerStoredContactListRoot();
diff --git a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java
index a3b75d7..6011b14 100644
--- a/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java
+++ b/test/net/java/sip/communicator/slick/contactlist/TestMetaContactListPersistence.java
@@ -189,10 +189,10 @@ public class TestMetaContactListPersistence extends TestCase
{
//verify that contents of the meta contact list matches contents of
//the mock provider we removed.
- ContactGroup oldProtoRoot = ((OperationSetPersistentPresence)fixture
- .mockProvider.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup oldProtoRoot =
+ ((OperationSetPersistentPresence) fixture.mockProvider
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
fixture.assertGroupEquals(
(MockContactGroup)oldProtoRoot
@@ -202,10 +202,10 @@ public class TestMetaContactListPersistence extends TestCase
//verify that the new mock provider has created unresolved contacts
//for all contacts in the meta cl.
- ContactGroup newProtoRoot = ((OperationSetPersistentPresence)fixture
- .replacementMockPr.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup newProtoRoot =
+ ((OperationSetPersistentPresence) fixture.replacementMockPr
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
, oldProtoRoot
@@ -239,32 +239,32 @@ public class TestMetaContactListPersistence extends TestCase
.registerMockProviderService(fixture.replacementMockP2);
//Get references to the root groups of the 2 providers we removed
- ContactGroup oldProtoMockP1Root = ((OperationSetPersistentPresence)
- fixture.mockP1.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup oldProtoMockP1Root =
+ ((OperationSetPersistentPresence) fixture.mockP1
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
- ContactGroup oldProtoMockP2Root = ( (OperationSetPersistentPresence)
- fixture.mockP2.getSupportedOperationSets().
- get(OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup oldProtoMockP2Root =
+ ((OperationSetPersistentPresence) fixture.mockP2
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
//verify that contacts tnat unresolved contacts that have been created
//inside that the replacement mock providers match those in the
//providers we removed.
- ContactGroup newProtoMockP1Root = ((OperationSetPersistentPresence)fixture
- .replacementMockP1.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup newProtoMockP1Root =
+ ((OperationSetPersistentPresence) fixture.replacementMockP1
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
, oldProtoMockP1Root
, newProtoMockP1Root);
- ContactGroup newProtoMockP2Root = ((OperationSetPersistentPresence)fixture
- .replacementMockP2.getSupportedOperationSets().get(
- OperationSetPersistentPresence.class.getName()))
- .getServerStoredContactListRoot();
+ ContactGroup newProtoMockP2Root =
+ ((OperationSetPersistentPresence) fixture.replacementMockP2
+ .getOperationSet(OperationSetPersistentPresence.class))
+ .getServerStoredContactListRoot();
assertEquals("Newly loaded provider does not match the old one."
, oldProtoMockP2Root