diff options
author | Alex Clayton <alex.clayton@isode.com> | 2016-03-11 09:38:40 (GMT) |
---|---|---|
committer | Alex Clayton <alex.clayton@isode.com> | 2016-03-14 14:59:53 (GMT) |
commit | c77facbc3036590cfa347f38859f9f536f082d6b (patch) | |
tree | 6ea804994bac2bc8fe76736b61075deeb02b6932 /test/com/isode | |
parent | ecec6f30d6d91ea17b8ed9f6a31dc4702e759585 (diff) | |
download | stroke-c77facbc3036590cfa347f38859f9f536f082d6b.zip stroke-c77facbc3036590cfa347f38859f9f536f082d6b.tar.bz2 |
Add roster to PresenceOracle.
As per patch 'Mark removed contacts as unavailable in Swift'
(9e6ee0f262e7dc663f4c706b16a346a268f425aa) added an XMPPRoster to the
member variables and constructor arguments for PresenceOracle.
Test-information: Unit tests pass.
Change-Id: I062d256c088a968e061d864fbd1386f850b614a7
Diffstat (limited to 'test/com/isode')
-rw-r--r-- | test/com/isode/stroke/presence/PresenceOracleTest.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/com/isode/stroke/presence/PresenceOracleTest.java b/test/com/isode/stroke/presence/PresenceOracleTest.java index 03aea04..ac82045 100644 --- a/test/com/isode/stroke/presence/PresenceOracleTest.java +++ b/test/com/isode/stroke/presence/PresenceOracleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -16,8 +16,10 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; + import org.junit.Test; import org.junit.Before; + import com.isode.stroke.elements.Presence; import com.isode.stroke.elements.Payload; import com.isode.stroke.client.DummyStanzaChannel; @@ -27,10 +29,13 @@ import com.isode.stroke.presence.PayloadAddingPresenceSender; import com.isode.stroke.presence.PresenceOracle; import com.isode.stroke.presence.SubscriptionManager; import com.isode.stroke.jid.JID; +import com.isode.stroke.roster.XMPPRoster; +import com.isode.stroke.roster.XMPPRosterImpl; import com.isode.stroke.signals.SignalConnection; import com.isode.stroke.signals.Slot2; import com.isode.stroke.signals.Slot3; import com.isode.stroke.signals.Slot1; + import java.util.Collection; import java.util.Vector; @@ -49,6 +54,7 @@ public class PresenceOracleTest { private PresenceOracle oracle_; private SubscriptionManager subscriptionManager_; private DummyStanzaChannel stanzaChannel_; + private XMPPRoster xmppRoster_; private Collection<Presence> changes = new Vector<Presence>(); private Collection<SubscriptionRequestInfo> subscriptionRequests = new Vector<SubscriptionRequestInfo>(); private JID user1; @@ -89,7 +95,8 @@ public class PresenceOracleTest { @Before public void setUp() { stanzaChannel_ = new DummyStanzaChannel(); - oracle_ = new PresenceOracle(stanzaChannel_); + xmppRoster_ = new XMPPRosterImpl(); + oracle_ = new PresenceOracle(stanzaChannel_,xmppRoster_); oracle_.onPresenceChange.connect(new Slot1<Presence>() { @Override public void call(Presence p) { |