From ad756810c1b2e49990534d30af9b3cb8e11de60b Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Thu, 3 Mar 2022 17:06:25 +0100 Subject: [PATCH] SINT: Removing invalid test The implementation of the test that is being removed depends on a server characteristic that will cause a loop of presence stanzas (which obviously is bad). A RFC3921-compliant client can send an 'acknowledgement' after receiving a presence 'subscribed' stanza, in the form of a presence 'subscribe' stanza. See section 8.2 of RFC3921. When a server implementation does not ignore this acknowledgement, the domain of the recipient MUST (RFC6121 section 3.1.3) respond with a 'subscribed' on behalf of the recipient (which is what the now removed test was verifying). This can trigger the RFC3921-compliant sender to again receive 'subscribed', that it again can acknowledge, which causes a loop. To test RFC6121, the subscription state of the recipient must somehow be modified to reflect a different state than that of the initiator. I'm not sure if that is feasible with the SINT framework. --- .../smack/roster/RosterIntegrationTest.java | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java index 23cb49deb..091293c4d 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java @@ -178,54 +178,6 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest { } } - /** - * Asserts that when a user sends out a presence subscription request to an entity for which the user already has - * an approved subscription, the server sends an auto-reply back to the user. - * - *

From RFC6121 ยง 3.1.3:

- *
- * If the contact exists and the user already has a subscription to the contact's presence, then the contact's - * server MUST auto-reply on behalf of the contact by sending a presence stanza of type "subscribed" from the - * contact's bare JID to the user's bare JID. - *
- * - * @throws Exception when errors occur - */ - @SmackIntegrationTest - public void testAutoReplyForRequestWhenAlreadySubscribed() throws Exception { - IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, connection.getReplyTimeout()); - - final SimpleResultSyncPoint added = new SimpleResultSyncPoint(); - - final StanzaListener stanzaListener = stanza -> { - final Presence presence = (Presence) stanza; - if (!presence.getTo().isEntityBareJid()) { - added.signalFailure("'to' address should be a bare JID, but is a full JID."); - } else if (!presence.getFrom().isEntityBareJid()) { - added.signalFailure("'from' address should be a bare JID, but is a full JID."); - } else if (presence.getType() != Presence.Type.subscribed) { - added.signalFailure("Incorrect subscription type on auto-reply: " + presence.getType()); - } else { - added.signal(); - } - }; - - conOne.addAsyncStanzaListener(stanzaListener, new AndFilter(StanzaTypeFilter.PRESENCE, FromMatchesFilter.createBare(conTwo.getUser()))); - - final Presence subscribe = PresenceBuilder.buildPresence() - .ofType(Presence.Type.subscribe) - .to(conTwo.getUser().asBareJid()) - .build(); - - try { - conOne.sendStanza(subscribe); - - assertTrue(added.waitForResult(2 * connection.getReplyTimeout())); - } finally { - conOne.removeAsyncStanzaListener(stanzaListener); - } - } - /** * Asserts that when a user sends out a presence subscription request to an entity for which the user does not have * a pre-existing subscription, the server will deliver the subscription request to that entity.