This is an automated email from the ASF dual-hosted git repository.
ralaoui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-vysper.git
The following commit(s) were added to refs/heads/master by this push:
new 3e7d2b9 Remove LocalDeliveryUtils in favor of StanzaBroker
3e7d2b9 is described below
commit 3e7d2b9e0b96a011bc72a1ea0cfaef3098c2de80
Author: Réda Housni Alaoui <[email protected]>
AuthorDate: Sun Sep 1 17:12:14 2019 +0200
Remove LocalDeliveryUtils in favor of StanzaBroker
---
.../core/im/handler/PresenceHandlerBaseTestCase.java | 7 +------
.../handler/PresenceSubRequestOutHandlerTestCase.java | 18 +++++++++---------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git
a/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceHandlerBaseTestCase.java
b/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceHandlerBaseTestCase.java
index a1a4c46..f5241e6 100644
---
a/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceHandlerBaseTestCase.java
+++
b/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceHandlerBaseTestCase.java
@@ -152,10 +152,6 @@ abstract public class PresenceHandlerBaseTestCase extends
TestCase {
assertStanzasRelayed(expectedRelayedAndDelivered,
expectedRelayedAndDelivered);
}
- protected void assertStanzasReceivedDirectly(int expectedReceivedDirectly)
{
- assertEquals(expectedReceivedDirectly,
sessionContext.getRecordedResponsesTotal());
- }
-
protected void assertStanzasRelayed(int expectedRelayed, int
expectedDelivered) {
assertEquals(expectedRelayed, ((StanzaReceiverRelay)
sessionContext.getStanzaRelay()).getCountRelayed());
assertEquals(expectedDelivered, ((StanzaReceiverRelay)
sessionContext.getStanzaRelay()).getCountDelivered());
@@ -208,8 +204,7 @@ abstract public class PresenceHandlerBaseTestCase extends
TestCase {
* @param testUser
* @return NULL, if no stanza available matching the user's resource id
*/
- protected Stanza getNextDirectResponseFor(TestUser testUser) {
+ protected Stanza getNextRelayedResponseFor(TestUser testUser) {
return testUser.getNextStanza();
-// return
sessionContext.getNextRecordedResponseForResource(testUser.getBoundResourceId());
}
}
diff --git
a/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubRequestOutHandlerTestCase.java
b/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubRequestOutHandlerTestCase.java
index 8d8153e..eaf6e36 100644
---
a/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubRequestOutHandlerTestCase.java
+++
b/server/core/src/test/java/org/apache/vysper/xmpp/modules/core/im/handler/PresenceSubRequestOutHandlerTestCase.java
@@ -83,28 +83,28 @@ public class PresenceSubRequestOutHandlerTestCase extends
PresenceHandlerBaseTes
assertStanzasDeliveredAndRelayed(4);
// roster push for 1 interested initiator of _same_ session
- Stanza initiatorNotification =
getNextDirectResponseFor(initiatingUser);
+ Stanza initiatorNotification =
getNextRelayedResponseFor(initiatingUser);
assertTrue(checkRosterPush(initiatorNotification,
initiatingUser.getEntityFQ(), unrelatedUser.getEntity(), NONE,
ASK_SUBSCRIBE));
// no stanzas for not interested
- assertNull(getNextDirectResponseFor(anotherAvailableUser));
+ assertNull(getNextRelayedResponseFor(anotherAvailableUser));
// roster 2 interested resources of _same_ session...
// roster push for interested
- Stanza interestedResourceNotification =
getNextDirectResponseFor(anotherInterestedUser);
+ Stanza interestedResourceNotification =
getNextRelayedResponseFor(anotherInterestedUser);
assertTrue(checkRosterPush(interestedResourceNotification,
new EntityImpl(initiatingUser.getEntity(),
anotherInterestedUser.getBoundResourceId()),
unrelatedUser.getEntity(), NONE, ASK_SUBSCRIBE));
- assertNull(getNextDirectResponseFor(anotherInterestedUser)); // no
more stanzas;
+ assertNull(getNextRelayedResponseFor(anotherInterestedUser)); // no
more stanzas;
// roster push for interested but not avail
- Stanza interestedNotYetAvailResourceNotification =
getNextDirectResponseFor(anotherInterestedNotAvailUser);
+ Stanza interestedNotYetAvailResourceNotification =
getNextRelayedResponseFor(anotherInterestedNotAvailUser);
assertTrue(checkRosterPush(interestedNotYetAvailResourceNotification,
new EntityImpl(initiatingUser.getEntity(),
anotherInterestedNotAvailUser.getBoundResourceId()),
unrelatedUser.getEntity(), NONE, ASK_SUBSCRIBE));
- assertNull(getNextDirectResponseFor(anotherInterestedNotAvailUser));
// no more stanzas;
+ assertNull(getNextRelayedResponseFor(anotherInterestedNotAvailUser));
// no more stanzas;
// sub request sent to contact
assertTrue(checkPresence(unrelatedUser.getNextStanza(),
PresenceStanzaType.SUBSCRIBE,
@@ -133,15 +133,15 @@ public class PresenceSubRequestOutHandlerTestCase extends
PresenceHandlerBaseTes
assertStanzasDeliveredAndRelayed(4);
// roster push for 1 interested initiator...
- Stanza initiatorNotification =
getNextDirectResponseFor(initiatingUser);
+ Stanza initiatorNotification =
getNextRelayedResponseFor(initiatingUser);
assertTrue(checkRosterPush(initiatorNotification,
initiatingUser.getEntityFQ(), subscribed_FROM.getEntity(),
FROM, ASK_SUBSCRIBE));
// .. and 2 interested resources of _same_ session
- Stanza anotherInterestedUserNotification =
getNextDirectResponseFor(anotherInterestedUser);
+ Stanza anotherInterestedUserNotification =
getNextRelayedResponseFor(anotherInterestedUser);
assertTrue(checkRosterPush(anotherInterestedUserNotification,
anotherInterestedUser.getEntityFQ(),
subscribed_FROM.getEntity(), FROM, ASK_SUBSCRIBE));
- Stanza anotherInterestedNotAvailUserNotification =
getNextDirectResponseFor(anotherInterestedNotAvailUser);
+ Stanza anotherInterestedNotAvailUserNotification =
getNextRelayedResponseFor(anotherInterestedNotAvailUser);
assertTrue(checkRosterPush(anotherInterestedNotAvailUserNotification,
anotherInterestedNotAvailUser.getEntityFQ(),
subscribed_FROM.getEntity(), FROM, ASK_SUBSCRIBE));