Package org.jivesoftware.smackx.muc
Class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest
- java.lang.Object
-
- org.igniterealtime.smack.inttest.AbstractSmackIntTest
-
- org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
-
- org.jivesoftware.smackx.muc.AbstractMultiUserChatIntegrationTest
-
- org.jivesoftware.smackx.muc.MultiUserChatRolesAffiliationsPrivilegesIntegrationTest
-
@SpecificationReference(document="XEP-0045") public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends AbstractMultiUserChatIntegrationTest
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
AbstractSmackIntTest.Condition
-
-
Field Summary
-
Fields inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
connection, connections, conOne, conThree, conTwo
-
Fields inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
INSECURE_RANDOM, LOGGER, sinttestConfiguration, testRunId, timeout
-
-
Constructor Summary
Constructors Constructor Description MultiUserChatRolesAffiliationsPrivilegesIntegrationTest(SmackIntegrationTestEnvironment environment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mucAffiliationTestForReceivingAdmin()
Asserts that a user who undergoes an affiliation change receives that change as a presence update.void
mucAffiliationTestForRemovingAdmin()
Asserts that a user who undergoes an affiliation change receives that change as a presence update.void
mucAffiliationTestForWitnessingAdmin()
Asserts that a user who is present when another user undergoes an affiliation change receives that change as a presence update.void
mucAffiliationTestForWitnessingAdminRemoval()
Asserts that a user who is present when another user undergoes an affiliation change receives that change as a presence updatevoid
mucPresenceTestForGettingKicked()
Asserts that a user who gets kicked receives that change as a presence update.void
mucPresenceTestForWitnessingKick()
Asserts that a user who is present when another user gets kicked receives that change as a presence update.void
mucRoleTestForReceivingModerator()
Asserts that a user who undergoes a role change receives that change as a presence update.void
mucRoleTestForRemovingModerator()
Asserts that a user who undergoes a role change receives that change as a presence update.void
mucRoleTestForRevokingVoice()
Asserts that a user in an unmoderated room who undergoes an afilliation change receives that change as a presence update.void
mucRoleTestForWitnessingModerator()
Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.void
mucRoleTestForWitnessingModeratorRemoval()
Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.void
mucRoleTestForWitnessingRevokingVoice()
Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.void
mucTestDefaultRoleForAffiliationInMembersOnlyRoom()
Asserts that a members-only room assigns the correct default roles for a given affiliation.void
mucTestDefaultRoleForAffiliationInModeratedRoom()
Asserts that a moderated room assigns the correct default roles for a given affiliation.void
mucTestDefaultRoleForAffiliationInUnmoderatedRoom()
Asserts that an unmoderated room assigns the correct default roles for a given affiliation.void
mucTestModeratorCannotBeRevokedFromHigherAffiliation()
Asserts that a moderator cannot revoke moderator privileges from a moderator with a higher affiliation than themselves.void
mucTestModeratorCannotRevokeVoiceFromOwner()
Asserts that a moderator cannot revoke voice from an owner.void
mucTestPersistentAffiliation()
Asserts that an affiliation is persistent between visits to the room.-
Methods inherited from class org.jivesoftware.smackx.muc.AbstractMultiUserChatIntegrationTest
getRandomRoom
-
Methods inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
performActionAndWaitForPresence
-
Methods inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
assertResult, assertResult, createNewTempFile, getHttpUrlConnectionFor, performActionAndWaitUntilStanzaReceived, waitUntilTrue
-
-
-
-
Constructor Detail
-
MultiUserChatRolesAffiliationsPrivilegesIntegrationTest
public MultiUserChatRolesAffiliationsPrivilegesIntegrationTest(SmackIntegrationTestEnvironment environment) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, TestNotPossibleException
- Throws:
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
TestNotPossibleException
-
-
Method Detail
-
mucRoleTestForReceivingModerator
@SmackIntegrationTest(section="5.1.3", quote="(\u00a7 5.1.3)... a MUC service implementation MUST change the occupant\'s role to reflect the change and communicate the change to all occupants [...] (\u00a7 9.6) The service MUST then send updated presence from this individual to all occupants, indicating the addition of moderator status...") public void mucRoleTestForReceivingModerator() throws java.lang.Exception
Asserts that a user who undergoes a role change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucRoleTestForWitnessingModerator
@SmackIntegrationTest(section="9.6", quote="(\u00a7 5.1.3)... a MUC service implementation MUST change the occupant\'s role to reflect the change and communicate the change to all occupants [...] (\u00a7 9.6) The service MUST then send updated presence from this individual to all occupants, indicating the addition of moderator status...") public void mucRoleTestForWitnessingModerator() throws java.lang.Exception
Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucRoleTestForRemovingModerator
@SmackIntegrationTest(section="5.1.3", quote="(\u00a7 5.1.3)... a MUC service implementation MUST change the occupant\'s role to reflect the change and communicate the change to all occupants [...] (\u00a7 9.7) The service MUST then send updated presence from this individual to all occupants, indicating the removal of moderator status...") public void mucRoleTestForRemovingModerator() throws java.lang.Exception
Asserts that a user who undergoes a role change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucRoleTestForWitnessingModeratorRemoval
@SmackIntegrationTest(section="9.7", quote="(\u00a7 5.1.3)... a MUC service implementation MUST change the occupant\'s role to reflect the change and communicate the change to all occupants [...] (\u00a7 9.7) The service MUST then send updated presence from this individual to all occupants, indicating the removal of moderator status...") public void mucRoleTestForWitnessingModeratorRemoval() throws java.lang.Exception
Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucRoleTestForRevokingVoice
@SmackIntegrationTest(section="5.1.3", quote="(\u00a7 5.1.3)... a MUC service implementation MUST change the occupant\'s role to reflect the change and communicate the change to all occupants [...] (\u00a7 8.4) The service MUST then send updated presence from this individual to all occupants, indicating the removal of voice privileges...") public void mucRoleTestForRevokingVoice() throws java.lang.Exception
Asserts that a user in an unmoderated room who undergoes an afilliation change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucRoleTestForWitnessingRevokingVoice
@SmackIntegrationTest(section="8.4", quote="(\u00a7 5.1.3)... a MUC service implementation MUST change the occupant\'s role to reflect the change and communicate the change to all occupants [...] (\u00a7 8.4) The service MUST then send updated presence from this individual to all occupants, indicating the removal of voice privileges...") public void mucRoleTestForWitnessingRevokingVoice() throws java.lang.Exception
Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucAffiliationTestForReceivingAdmin
@SmackIntegrationTest(section="5.2.2", quote="(\u00a7 5.2.2) ... a MUC service implementation MUST change the user\'s affiliation to reflect the change and communicate that to all occupants [...] (\u00a7 10.6) If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the granting of admin status...") public void mucAffiliationTestForReceivingAdmin() throws java.lang.Exception
Asserts that a user who undergoes an affiliation change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucAffiliationTestForWitnessingAdmin
@SmackIntegrationTest(section="10.6", quote="(\u00a7 5.2.2) ... a MUC service implementation MUST change the user\'s affiliation to reflect the change and communicate that to all occupants [...] (\u00a7 10.6) If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the granting of admin status...") public void mucAffiliationTestForWitnessingAdmin() throws java.lang.Exception
Asserts that a user who is present when another user undergoes an affiliation change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucAffiliationTestForRemovingAdmin
@SmackIntegrationTest(section="10.7", quote="(\u00a7 5.2.2) ... a MUC service implementation MUST change the user\'s affiliation to reflect the change and communicate that to all occupants [...] (\u00a7 10.6) If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the loss of admin status by sending a presence element...") public void mucAffiliationTestForRemovingAdmin() throws java.lang.Exception
Asserts that a user who undergoes an affiliation change receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucAffiliationTestForWitnessingAdminRemoval
@SmackIntegrationTest(section="10.7", quote="(\u00a7 5.2.2) ... a MUC service implementation MUST change the user\'s affiliation to reflect the change and communicate that to all occupants [...] (\u00a7 10.6) If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the loss of admin status by sending a presence element...") public void mucAffiliationTestForWitnessingAdminRemoval() throws java.lang.Exception
Asserts that a user who is present when another user undergoes an affiliation change receives that change as a presence updateFrom XEP-0045 § 5.2.2:
...a MUC service implementation MUST change the user's affiliation to reflect the change and communicate that to all occupants...
From XEP-0045 § 10.7:
If the user is in the room, the service MUST then send updated presence from this individual to all occupants, indicating the loss of admin status by sending a presence element...
- Throws:
java.lang.Exception
- when errors occur
-
mucPresenceTestForGettingKicked
@SmackIntegrationTest(section="8.2", quote="The kick is performed based on the occupant\'s room nickname and is completed by setting the role of a participant or visitor to a value of \"none\". The service MUST remove the kicked occupant by sending a presence stanza of type \"unavailable\" to each kicked occupant, including status code 307 in the extended presence information, optionally along with the reason (if provided) and the roomnick or bare JID of the user who initiated the kick.") public void mucPresenceTestForGettingKicked() throws java.lang.Exception
Asserts that a user who gets kicked receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucPresenceTestForWitnessingKick
@SmackIntegrationTest(section="8.2", quote="...the service MUST then inform all of the remaining occupants that the kicked occupant is no longer in the room by sending presence stanzas of type \"unavailable\" from the individual\'s roomnick (<room@service/nick>) to all the remaining occupants (just as it does when occupants exit the room of their own volition), including the status code and optionally the reason and actor.") public void mucPresenceTestForWitnessingKick() throws java.lang.Exception
Asserts that a user who is present when another user gets kicked receives that change as a presence update.- Throws:
java.lang.Exception
- when errors occur
-
mucTestPersistentAffiliation
@SmackIntegrationTest(section="5.2", quote="These affiliations are long-lived in that they persist across a user\'s visits to the room and are not affected by happenings in the room...Affiliations are granted, revoked, and maintained based on the user\'s bare JID, not the nick as with roles.") public void mucTestPersistentAffiliation() throws java.lang.Exception
Asserts that an affiliation is persistent between visits to the room.- Throws:
java.lang.Exception
- when errors occur
-
mucTestModeratorCannotRevokeVoiceFromOwner
@SmackIntegrationTest(section="5.1.1", quote="A moderator MUST NOT be able to revoke voice privileges from an admin or owner [...] (\u00a7 8.4) A moderator MUST NOT be able to revoke voice from a user whose affiliation is at or above the moderator\'s level. In addition, a service MUST NOT allow the voice privileges of an admin or owner to be removed by anyone. If a moderator attempts to revoke voice privileges from such a user, the service MUST deny the request and return a <not-allowed/> error to the sender along with the offending item(s)") public void mucTestModeratorCannotRevokeVoiceFromOwner() throws java.lang.Exception
Asserts that a moderator cannot revoke voice from an owner.- Throws:
java.lang.Exception
- when errors occur
-
mucTestModeratorCannotBeRevokedFromHigherAffiliation
@SmackIntegrationTest(section="5.1.3", quote="A moderator SHOULD NOT be allowed to revoke moderation privileges from someone with a higher affiliation than themselves (i.e., an unaffiliated moderator SHOULD NOT be allowed to revoke moderation privileges from an admin or an owner, and an admin SHOULD NOT be allowed to revoke moderation privileges from an owner)") public void mucTestModeratorCannotBeRevokedFromHigherAffiliation() throws java.lang.Exception
Asserts that a moderator cannot revoke moderator privileges from a moderator with a higher affiliation than themselves.- Throws:
java.lang.Exception
- when errors occur
-
mucTestDefaultRoleForAffiliationInUnmoderatedRoom
@SmackIntegrationTest(section="5.1.2", quote="...the initial default roles that a service SHOULD set based on the user\'s affiliation...") public void mucTestDefaultRoleForAffiliationInUnmoderatedRoom() throws java.lang.Exception
Asserts that an unmoderated room assigns the correct default roles for a given affiliation.- Throws:
java.lang.Exception
- when errors occur
-
mucTestDefaultRoleForAffiliationInModeratedRoom
@SmackIntegrationTest(section="5.1.2", quote="...the initial default roles that a service SHOULD set based on the user\'s affiliation...") public void mucTestDefaultRoleForAffiliationInModeratedRoom() throws java.lang.Exception
Asserts that a moderated room assigns the correct default roles for a given affiliation.- Throws:
java.lang.Exception
- when errors occur
-
mucTestDefaultRoleForAffiliationInMembersOnlyRoom
@SmackIntegrationTest(section="5.1.2", quote="...the initial default roles that a service SHOULD set based on the user\'s affiliation...") public void mucTestDefaultRoleForAffiliationInMembersOnlyRoom() throws java.lang.Exception
Asserts that a members-only room assigns the correct default roles for a given affiliation.- Throws:
java.lang.Exception
- when errors occur
-
-