diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2008-12-09 20:45:16 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2008-12-09 20:45:16 +0000 |
commit | 331d75a93a6f83444b5d295c1697d6e707c19d46 (patch) | |
tree | caee2201bed2c1c616acc70e0b52f5b52a68d23b /test/net/java | |
parent | 690b5fa412f7e98f5e5e342d5879aaf4fda02922 (diff) | |
download | jitsi-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')
43 files changed, 192 insertions, 198 deletions
diff --git a/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java b/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java index 0485448..2f28d79 100644 --- a/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java +++ b/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java @@ -91,12 +91,9 @@ public class TestCallHistoryService mockProvider = new MockProvider("CallHistoryMockUser"); //store thre presence op set of the new provider into the fixture - Map supportedOperationSets = - mockProvider.getSupportedOperationSets(); - mockBTelphonyOpSet = - (MockOperationSetBasicTelephony) supportedOperationSets.get( - OperationSetBasicTelephony.class.getName()); + (MockOperationSetBasicTelephony) mockProvider + .getOperationSet(OperationSetBasicTelephony.class); System.setProperty(MetaContactListService.PROVIDER_MASK_PROPERTY, "1"); 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 diff --git a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java index 3c989a5..0a8f461 100644 --- a/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java +++ b/test/net/java/sip/communicator/slick/msghistory/TestMsgHistoryService.java @@ -111,7 +111,7 @@ public class TestMsgHistoryService mockProvider = new MockProvider("MessageHistoryMockUser"); //store thre presence op set of the new provider into the fixture - Map supportedOperationSets = + Map<String, OperationSet> supportedOperationSets = mockProvider.getSupportedOperationSets(); //get the operation set presence here. diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java index 4e35011..fc970b5 100644 --- a/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java +++ b/test/net/java/sip/communicator/slick/protocol/gibberish/GibberishSlickFixture.java @@ -216,7 +216,8 @@ public class GibberishSlickFixture public void clearProvidersLists() throws Exception { - Map supportedOperationSets1 = provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets1 = + provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null || supportedOperationSets1.size() < 1) @@ -238,7 +239,8 @@ public class GibberishSlickFixture + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java index ebf7cf6..2b45377 100644 --- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java +++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetBasicInstantMessaging.java @@ -10,6 +10,7 @@ import java.io.*; import java.util.*; import junit.framework.*; + import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; import net.java.sip.communicator.util.*; @@ -49,7 +50,7 @@ public class TestOperationSetBasicInstantMessaging super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -82,7 +83,7 @@ public class TestOperationSetBasicInstantMessaging + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java index e97f4ab..cf1009f 100644 --- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPersistentPresence.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.slick.protocol.gibberish; import java.util.*; import junit.framework.*; + import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; import net.java.sip.communicator.util.*; @@ -73,7 +74,7 @@ public class TestOperationSetPersistentPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -96,8 +97,8 @@ public class TestOperationSetPersistentPresence + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = - fixture.provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java index a57ddc1..51a5884 100644 --- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetPresence.java @@ -51,7 +51,7 @@ public class TestOperationSetPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -76,7 +76,7 @@ public class TestOperationSetPresence } // do it once again for the second provider - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java index 86fb2f6..f3db890 100644 --- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java +++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestOperationSetTypingNotifications.java @@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java b/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java index bc04f2f..6c6b6b8 100644 --- a/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/gibberish/TestProtocolProviderServiceGibberishImpl.java @@ -145,20 +145,19 @@ public class TestProtocolProviderServiceGibberishImpl */ public void testOperationSetTypes() throws Exception { - Map supportedOperationSets - = fixture.provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets = + fixture.provider1.getSupportedOperationSets(); - //make sure that keys (which are supposed to be class names) correspond - //what the class of the values recorded against them. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) + // make sure that keys (which are supposed to be class names) correspond + // what the class of the values recorded against them. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) { - String setName = (String) setNames.next(); - Object opSet = supportedOperationSets.get(setName); + String setName = entry.getKey(); + Object opSet = entry.getValue(); - assertTrue(opSet + " was not an instance of " - + setName + " as declared" - , Class.forName(setName).isInstance(opSet)); + assertTrue(opSet + " was not an instance of " + setName + + " as declared", Class.forName(setName).isInstance(opSet)); } } diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java index 1f171c7..9d5232e 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetBasicInstantMessaging.java @@ -48,7 +48,7 @@ public class TestOperationSetBasicInstantMessaging super.setUp(); fixture.setUp(); - Map supportedOperationSets = + Map<String, OperationSet> supportedOperationSets = fixture.provider.getSupportedOperationSets(); if ( supportedOperationSets == null diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java index 33082c0..12d465e 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java @@ -75,7 +75,7 @@ public class TestOperationSetPersistentPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets = + Map<String, OperationSet> supportedOperationSets = fixture.provider.getSupportedOperationSets(); if ( supportedOperationSets == null diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java index 8551173..b6b2124 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java @@ -53,7 +53,7 @@ public class TestOperationSetPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets = + Map<String, OperationSet> supportedOperationSets = fixture.provider.getSupportedOperationSets(); if ( supportedOperationSets == null diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java index 47cdb60..d65f588 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetServerStoredInfo.java @@ -47,7 +47,7 @@ public class TestOperationSetServerStoredInfo super.setUp(); fixture.setUp(); - Map supportedOperationSets = + Map<String, OperationSet> supportedOperationSets = fixture.provider.getSupportedOperationSets(); if ( supportedOperationSets == null diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java index 7b386c4..2ad71d3 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetTypingNotifications.java @@ -42,7 +42,7 @@ public class TestOperationSetTypingNotifications super.setUp(); fixture.setUp(); - Map supportedOperationSets = + Map<String, OperationSet> supportedOperationSets = fixture.provider.getSupportedOperationSets(); if ( supportedOperationSets == null diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java b/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java index dadcdc4..e56f2d7 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestProtocolProviderServiceIcqImpl.java @@ -146,11 +146,9 @@ public class TestProtocolProviderServiceIcqImpl extends TestCase // Here is registered the listener which will receive the first message // This message is supposed to be offline message and as one is tested // in TestOperationSetBasicInstantMessaging.testReceiveOfflineMessages() - Map supportedOperationSets = - fixture.provider.getSupportedOperationSets(); OperationSetBasicInstantMessaging opSetBasicIM = - (OperationSetBasicInstantMessaging)supportedOperationSets.get( - OperationSetBasicInstantMessaging.class.getName()); + (OperationSetBasicInstantMessaging) fixture.provider + .getOperationSet(OperationSetBasicInstantMessaging.class); fixture.offlineMsgCollector.register(opSetBasicIM); //give time for the AIM server to notify everyone of our arrival @@ -236,24 +234,22 @@ public class TestProtocolProviderServiceIcqImpl extends TestCase */ public void testOperationSetTypes() throws Exception { - Map supportedOperationSets - = fixture.provider.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets = + fixture.provider.getSupportedOperationSets(); - //make sure that keys (which are supposed to be class names) correspond - //what the class of the values recorded against them. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) + // make sure that keys (which are supposed to be class names) correspond + // what the class of the values recorded against them. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) { - String setName = (String) setNames.next(); - Object opSet = supportedOperationSets.get(setName); + String setName = entry.getKey(); + Object opSet = entry.getValue(); - assertTrue(opSet + " was not an instance of " - + setName + " as declared" - , Class.forName(setName).isInstance(opSet)); + assertTrue(opSet + " was not an instance of " + setName + + " as declared", Class.forName(setName).isInstance(opSet)); } } - /** * A class that would plugin as a registration listener to a protocol * provider and simply record all events that it sees and notify the diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java index 86f78e9..ce63093 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/JabberSlickFixture.java @@ -7,7 +7,6 @@ package net.java.sip.communicator.slick.protocol.jabber; import java.util.*; -import java.util.Map; import org.osgi.framework.*; @@ -229,7 +228,8 @@ public class JabberSlickFixture public void clearProvidersLists() throws Exception { - Map supportedOperationSets1 = provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets1 = + provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null || supportedOperationSets1.size() < 1) @@ -251,7 +251,8 @@ public class JabberSlickFixture + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java index 5dee6bb..9885443 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicInstantMessaging.java @@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java index 4b0f7e2..cb7d7f3 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat.java @@ -96,7 +96,7 @@ public class TestOperationSetMultiUserChat super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -129,7 +129,7 @@ public class TestOperationSetMultiUserChat + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java index ad9e4c7..b11d3c9 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPersistentPresence.java @@ -70,7 +70,7 @@ public class TestOperationSetPersistentPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -93,8 +93,8 @@ public class TestOperationSetPersistentPresence + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = - fixture.provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java index 9e956be..1ad8f03 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetPresence.java @@ -55,7 +55,7 @@ public class TestOperationSetPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -80,7 +80,7 @@ public class TestOperationSetPresence } // do it once again for the second provider - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java index 5fcb502..c938cce 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetTypingNotifications.java @@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java index 4181b3e..a8b7e4b 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestProtocolProviderServiceJabberImpl.java @@ -145,20 +145,19 @@ public class TestProtocolProviderServiceJabberImpl */ public void testOperationSetTypes() throws Exception { - Map supportedOperationSets - = fixture.provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets = + fixture.provider1.getSupportedOperationSets(); - //make sure that keys (which are supposed to be class names) correspond - //what the class of the values recorded against them. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) + // make sure that keys (which are supposed to be class names) correspond + // what the class of the values recorded against them. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) { - String setName = (String) setNames.next(); - Object opSet = supportedOperationSets.get(setName); + String setName = entry.getKey(); + Object opSet = entry.getValue(); - assertTrue(opSet + " was not an instance of " - + setName + " as declared" - , Class.forName(setName).isInstance(opSet)); + assertTrue(opSet + " was not an instance of " + setName + + " as declared", Class.forName(setName).isInstance(opSet)); } } diff --git a/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java index 330c1e2..fd00ebc 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/MsnSlickFixture.java @@ -9,7 +9,7 @@ package net.java.sip.communicator.slick.protocol.msn; import org.osgi.framework.*; import junit.framework.*; import net.java.sip.communicator.service.protocol.*; -import java.util.Map; + import java.util.*; /** @@ -214,7 +214,8 @@ public class MsnSlickFixture public void clearProvidersLists() throws Exception { - Map supportedOperationSets1 = provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets1 = + provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null || supportedOperationSets1.size() < 1) @@ -236,7 +237,8 @@ public class MsnSlickFixture + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java index b229d83..329badb 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetBasicInstantMessaging.java @@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java index 2e98202..18d26d7 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPersistentPresence.java @@ -70,7 +70,7 @@ public class TestOperationSetPersistentPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -93,8 +93,8 @@ public class TestOperationSetPersistentPresence + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = - fixture.provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java index 7029857..00c5df9 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java @@ -49,7 +49,7 @@ public class TestOperationSetPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -74,7 +74,7 @@ public class TestOperationSetPresence } // do it once again for the second provider - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java index 27cde0d..4eb90e4 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetTypingNotifications.java @@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java b/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java index a4f0c0b..7eb3604 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/TestProtocolProviderServiceMsnImpl.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.slick.protocol.msn; import java.util.*; import junit.framework.*; + import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; import net.java.sip.communicator.util.*; @@ -145,20 +146,19 @@ public class TestProtocolProviderServiceMsnImpl */ public void testOperationSetTypes() throws Exception { - Map supportedOperationSets - = fixture.provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets = + fixture.provider1.getSupportedOperationSets(); - //make sure that keys (which are supposed to be class names) correspond - //what the class of the values recorded against them. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) + // make sure that keys (which are supposed to be class names) correspond + // what the class of the values recorded against them. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) { - String setName = (String) setNames.next(); - Object opSet = supportedOperationSets.get(setName); + String setName = entry.getKey(); + Object opSet = entry.getValue(); - assertTrue(opSet + " was not an instance of " - + setName + " as declared" - , Class.forName(setName).isInstance(opSet)); + assertTrue(opSet + " was not an instance of " + setName + + " as declared", Class.forName(setName).isInstance(opSet)); } } diff --git a/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java b/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java index 503746f..2c97bdf 100755 --- a/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/rss/TestProtocolProviderServiceRssImpl.java @@ -116,20 +116,21 @@ public class TestProtocolProviderServiceRssImpl */ public void testOperationsSets() throws ClassNotFoundException { - Map supportedOperationSets = - fixture.provider.getSupportedOperationSets(); - - //get the keys for the supported operation set. The keys are strings - //corresponding to class names. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) - { - String key = (String) setNames.next(); - Object opSet = supportedOperationSets.get(key); - - assertTrue(opSet + " was not an instance of " + key +"as declared", - Class.forName(key).isInstance(opSet)); - } + Map<String, OperationSet> supportedOperationSets = + fixture.provider.getSupportedOperationSets(); + + // get the keys for the supported operation set. The keys are strings + // corresponding to class names. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) + { + String key = entry.getKey(); + Object opSet = entry.getValue(); + + assertTrue( + opSet + " was not an instance of " + key + "as declared", Class + .forName(key).isInstance(opSet)); + } } /** diff --git a/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java index 557e23e..bb3e692 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/SipSlickFixture.java @@ -218,7 +218,8 @@ public class SipSlickFixture public void clearProvidersLists() throws Exception { - Map supportedOperationSets1 = provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets1 = + provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null || supportedOperationSets1.size() < 1) @@ -240,7 +241,8 @@ public class SipSlickFixture + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java index eccdef5..5e93db1 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicInstantMessaging.java @@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java index 2dab9a7..eaae996 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPersistentPresence.java @@ -73,7 +73,7 @@ public class TestOperationSetPersistentPresence super.setUp(); this.fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = this.fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -96,7 +96,7 @@ public class TestOperationSetPersistentPresence + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = this.fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java index 54216f3..bfd51c2 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetPresence.java @@ -49,7 +49,7 @@ public class TestOperationSetPresence super.setUp(); this.fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = this.fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -74,7 +74,7 @@ public class TestOperationSetPresence } // do it once again for the second provider - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = this.fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java b/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java index 044387a..091a484 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/TestProtocolProviderServiceSipImpl.java @@ -145,20 +145,19 @@ public class TestProtocolProviderServiceSipImpl */ public void testOperationSetTypes() throws Exception { - Map supportedOperationSets - = fixture.provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets = + fixture.provider1.getSupportedOperationSets(); - //make sure that keys (which are supposed to be class names) correspond - //what the class of the values recorded against them. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) + // make sure that keys (which are supposed to be class names) correspond + // what the class of the values recorded against them. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) { - String setName = (String) setNames.next(); - Object opSet = supportedOperationSets.get(setName); + String setName = entry.getKey(); + Object opSet = entry.getValue(); - assertTrue(opSet + " was not an instance of " - + setName + " as declared" - , Class.forName(setName).isInstance(opSet)); + assertTrue(opSet + " was not an instance of " + setName + + " as declared", Class.forName(setName).isInstance(opSet)); } } diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java index 3ab7398..cc25a0b 100644 --- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java +++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetBasicInstantMessaging.java @@ -49,7 +49,7 @@ public class TestOperationSetBasicInstantMessaging super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -82,7 +82,7 @@ public class TestOperationSetBasicInstantMessaging + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java index 163272b..7fdf536 100644 --- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPersistentPresence.java @@ -70,7 +70,7 @@ public class TestOperationSetPersistentPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -93,8 +93,8 @@ public class TestOperationSetPersistentPresence + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = - fixture.provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + fixture.provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java index c58b23e..14d3ecf 100644 --- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java @@ -51,7 +51,7 @@ public class TestOperationSetPresence super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -76,7 +76,7 @@ public class TestOperationSetPresence } // do it once again for the second provider - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java index 790a253..b3116a4 100644 --- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java +++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetTypingNotifications.java @@ -44,7 +44,7 @@ public class TestOperationSetTypingNotifications super.setUp(); fixture.setUp(); - Map supportedOperationSets1 = + Map<String, OperationSet> supportedOperationSets1 = fixture.provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null @@ -90,7 +90,7 @@ public class TestOperationSetTypingNotifications + "implementation of at least one of the PresenceOperationSets"); } - Map supportedOperationSets2 = + Map<String, OperationSet> supportedOperationSets2 = fixture.provider2.getSupportedOperationSets(); if ( supportedOperationSets2 == null diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java index cc4daa3..e32f9cf 100644 --- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestProtocolProviderServiceYahooImpl.java @@ -145,20 +145,19 @@ public class TestProtocolProviderServiceYahooImpl */ public void testOperationSetTypes() throws Exception { - Map supportedOperationSets - = fixture.provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets = + fixture.provider1.getSupportedOperationSets(); - //make sure that keys (which are supposed to be class names) correspond - //what the class of the values recorded against them. - Iterator setNames = supportedOperationSets.keySet().iterator(); - while (setNames.hasNext()) + // make sure that keys (which are supposed to be class names) correspond + // what the class of the values recorded against them. + for (Map.Entry<String, OperationSet> entry : supportedOperationSets + .entrySet()) { - String setName = (String) setNames.next(); - Object opSet = supportedOperationSets.get(setName); + String setName = entry.getKey(); + Object opSet = entry.getValue(); - assertTrue(opSet + " was not an instance of " - + setName + " as declared" - , Class.forName(setName).isInstance(opSet)); + assertTrue(opSet + " was not an instance of " + setName + + " as declared", Class.forName(setName).isInstance(opSet)); } } diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java b/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java index 75d9e0c..33371ed 100644 --- a/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java +++ b/test/net/java/sip/communicator/slick/protocol/yahoo/YahooSlickFixture.java @@ -9,7 +9,7 @@ package net.java.sip.communicator.slick.protocol.yahoo; import org.osgi.framework.*; import junit.framework.*; import net.java.sip.communicator.service.protocol.*; -import java.util.Map; + import java.util.*; /** @@ -214,7 +214,8 @@ public class YahooSlickFixture public void clearProvidersLists() throws Exception { - Map supportedOperationSets1 = provider1.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets1 = + provider1.getSupportedOperationSets(); if ( supportedOperationSets1 == null || supportedOperationSets1.size() < 1) @@ -236,7 +237,8 @@ public class YahooSlickFixture + "Operation Sets"); // lets do it once again for the second provider - Map supportedOperationSets2 = provider2.getSupportedOperationSets(); + Map<String, OperationSet> supportedOperationSets2 = + provider2.getSupportedOperationSets(); if (supportedOperationSets2 == null || supportedOperationSets2.size() < 1) |