From 5662485c70f3bffb928b3ba49e8d34746d2e4512 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Wed, 6 Jan 2010 10:04:18 +0000 Subject: [PATCH] Enable sip tests. --- build.xml | 19 +++++++++++++++---- lib/accounts.properties.template | 4 ++++ lib/felix.unit.test.properties | 1 - lib/testing.properties | 2 +- .../sip/OperationSetPresenceSipImpl.java | 10 +++++++++- .../sip/SipProtocolProviderServiceLick.java | 2 +- 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/build.xml b/build.xml index 38817bbf5..bf03f5313 100644 --- a/build.xml +++ b/build.xml @@ -553,6 +553,17 @@ + + + + + + + + + - - - - diff --git a/lib/accounts.properties.template b/lib/accounts.properties.template index f0277a3d2..a324e0624 100644 --- a/lib/accounts.properties.template +++ b/lib/accounts.properties.template @@ -106,6 +106,10 @@ accounts.sip.account2.PROXY_ADDRESS= # (Optional) accounts.sip.account2.PROXY_PORT= +# This will be the contact list which we will use to test persistent storing +# of sip protocol +accounts.sip.CONTACT_LIST= + # JABBER PROPERTIES # JABBER ACCOUNT 1 diff --git a/lib/felix.unit.test.properties b/lib/felix.unit.test.properties index e78e770cf..f8da6c919 100644 --- a/lib/felix.unit.test.properties +++ b/lib/felix.unit.test.properties @@ -45,7 +45,6 @@ org.osgi.framework.system.packages.extra= org.osgi.framework; ; version=1.3.0, \ org.jdesktop.jdic.tray; \ org.jdesktop.jdic.desktop; \ com.apple.cocoa.application; \ - net.java.sip.communicator.service.audionotifier; \ javax.crypto; \ javax.crypto.spec; \ javax.crypto.interfaces; \ diff --git a/lib/testing.properties b/lib/testing.properties index ecba6c951..cfc699d5d 100644 --- a/lib/testing.properties +++ b/lib/testing.properties @@ -23,6 +23,7 @@ net.java.sip.communicator.slick.runner.TEST_LIST=ConfigurationServiceLick \ MsnProtocolProviderSlick \ GibberishProtocolProviderServiceLick \ RssProtocolProviderServiceLick \ + SipProtocolProviderServiceLick \ PopupMessageHandlerSLick # Note that NetworkAddressManagerServiceLick currently runs @@ -36,7 +37,6 @@ net.java.sip.communicator.slick.runner.TEST_LIST=ConfigurationServiceLick \ # # MediaServiceLick because one of the 2 tests fails. # -# SipProtocolProviderServiceLick because fourteen of 25 tests fail. # # GenericProtocolProviderServiceLick because it does not add any tests. # diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java index ca5820408..02d34de6f 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetPresenceSipImpl.java @@ -996,6 +996,8 @@ public void unsubscribe(Contact contact) IllegalStateException, OperationFailedException { + assertConnected(); + if (!(contact instanceof ContactSipImpl)) throw new IllegalArgumentException( @@ -1003,7 +1005,13 @@ public void unsubscribe(Contact contact) ContactSipImpl sipcontact = (ContactSipImpl) contact; - unsubscribe(sipcontact, true); + /** + * Does not assert if there is no subscription cause if the user + * becomes offline he has terminated the subscription and so we have + * no subscription of this contact but we wont to remove it. + * Does not assert on connected cause have already has made the check. + */ + unsubscribe(sipcontact, false); ((ContactGroupSipImpl) sipcontact.getParentContactGroup()) .removeContact(sipcontact); diff --git a/test/net/java/sip/communicator/slick/protocol/sip/SipProtocolProviderServiceLick.java b/test/net/java/sip/communicator/slick/protocol/sip/SipProtocolProviderServiceLick.java index 0c3775bf4..c278d0c9d 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/SipProtocolProviderServiceLick.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/SipProtocolProviderServiceLick.java @@ -47,7 +47,7 @@ public class SipProtocolProviderServiceLick * contains the contact list that. */ public static final String CONTACT_LIST_PROPERTY_NAME - = "accounts.gibberish.CONTACT_LIST"; + = "accounts.sip.CONTACT_LIST"; /** * Initializes and registers all tests that we'll run as a part of this