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
-
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 voidmucAffiliationTestForReceivingAdmin()Asserts that a user who undergoes an affiliation change receives that change as a presence updatevoidmucAffiliationTestForRemovingAdmin()Asserts that a user who undergoes an affiliation change receives that change as a presence updatevoidmucAffiliationTestForWitnessingAdmin()Asserts that a user who is present when another user undergoes an affiliation change receives that change as a presence updatevoidmucAffiliationTestForWitnessingAdminRemoval()Asserts that a user who is present when another user undergoes an affiliation change receives that change as a presence updatevoidmucPresenceTestForGettingKicked()Asserts that a user who gets kicked receives that change as a presence updatevoidmucPresenceTestForWitnessingKick()Asserts that a user who is present when another user gets kicked receives that change as a presence updatevoidmucRoleTestForReceivingModerator()Asserts that a user who undergoes a role change receives that change as a presence updatevoidmucRoleTestForRemovingModerator()Asserts that a user who undergoes a role change receives that change as a presence updatevoidmucRoleTestForRevokingVoice()Asserts that a user in an unmoderated room who undergoes an afilliation change receives that change as a presence updatevoidmucRoleTestForWitnessingModerator()Asserts that a user who is present when another user undergoes a role change receives that change as a presence updatevoidmucRoleTestForWitnessingModeratorRemoval()Asserts that a user who is present when another user undergoes a role change receives that change as a presence updatevoidmucRoleTestForWitnessingRevokingVoice()Asserts that a user who is present when another user undergoes a role change receives that change as a presence updatevoidmucTestDefaultRoleForAffiliationInMembersOnlyRoom()Asserts that a members-only room assigns the correct default roles for a given affiliationvoidmucTestDefaultRoleForAffiliationInModeratedRoom()Asserts that a moderated room assigns the correct default roles for a given affiliationvoidmucTestDefaultRoleForAffiliationInUnmoderatedRoom()Asserts that an unmoderated room assigns the correct default roles for a given affiliationvoidmucTestModeratorCannotBeRevokedFromHigherAffiliation()Asserts that a moderator cannot revoke moderator privileges from a moderator with a higher affiliation than themselves.voidmucTestModeratorCannotRevokeVoiceFromOwner()Asserts that a moderator cannot revoke voice from an ownervoidmucTestPersistentAffiliation()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
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.NoResponseExceptionorg.jivesoftware.smack.XMPPException.XMPPErrorExceptionorg.jivesoftware.smack.SmackException.NotConnectedExceptionjava.lang.InterruptedExceptionTestNotPossibleException
-
-
Method Detail
-
mucRoleTestForReceivingModerator
@SmackIntegrationTest public void mucRoleTestForReceivingModerator() throws java.lang.Exception
Asserts that a user who undergoes a role change receives that change as a presence updateFrom XEP-0045 § 5.1.3:
...a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants...
From XEP-0045 § 9.6:
The service MUST then send updated presence from this individual to all occupants, indicating the addition of moderator status...
- Throws:
java.lang.Exception- when errors occur
-
mucRoleTestForWitnessingModerator
@SmackIntegrationTest 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 updateFrom XEP-0045 § 5.1.3:
...a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants...
From XEP-0045 § 9.6:
The service MUST then send updated presence from this individual to all occupants, indicating the addition of moderator status...
- Throws:
java.lang.Exception- when errors occur
-
mucRoleTestForRemovingModerator
@SmackIntegrationTest public void mucRoleTestForRemovingModerator() throws java.lang.Exception
Asserts that a user who undergoes a role change receives that change as a presence updateFrom XEP-0045 § 5.1.3:
...a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants...
From XEP-0045 § 9.7:
The service MUST then send updated presence from this individual to all occupants, indicating the removal of moderator status...
- Throws:
java.lang.Exception- when errors occur
-
mucRoleTestForWitnessingModeratorRemoval
@SmackIntegrationTest 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 updateFrom XEP-0045 § 5.1.3:
...a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants...
From XEP-0045 § 9.7:
The service MUST then send updated presence from this individual to all occupants, indicating the removal of moderator status...
- Throws:
java.lang.Exception- when errors occur
-
mucRoleTestForRevokingVoice
@SmackIntegrationTest 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 updateFrom XEP-0045 § 5.1.3:
...a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants...
From XEP-0045 § 8.4:
The service MUST then send updated presence from this individual to all occupants, indicating the removal of voice privileges...
- Throws:
java.lang.Exception- when errors occur
-
mucRoleTestForWitnessingRevokingVoice
@SmackIntegrationTest 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 updateFrom XEP-0045 § 5.1.3:
...a MUC service implementation MUST change the occupant's role to reflect the change and communicate the change to all occupants...
From XEP-0045 § 8.4:
The service MUST then send updated presence from this individual to all occupants, indicating the removal of voice privileges...
- Throws:
java.lang.Exception- when errors occur
-
mucAffiliationTestForReceivingAdmin
@SmackIntegrationTest public void mucAffiliationTestForReceivingAdmin() throws java.lang.Exception
Asserts that a user who 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.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...
- Throws:
java.lang.Exception- when errors occur
-
mucAffiliationTestForWitnessingAdmin
@SmackIntegrationTest 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 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.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...
- Throws:
java.lang.Exception- when errors occur
-
mucAffiliationTestForRemovingAdmin
@SmackIntegrationTest public void mucAffiliationTestForRemovingAdmin() throws java.lang.Exception
Asserts that a user who 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
-
mucAffiliationTestForWitnessingAdminRemoval
@SmackIntegrationTest 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 public void mucPresenceTestForGettingKicked() throws java.lang.Exception
Asserts that a user who gets kicked receives that change as a presence updateFrom XEP-0045 § 8.2:
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.
- Throws:
java.lang.Exception- when errors occur
-
mucPresenceTestForWitnessingKick
@SmackIntegrationTest 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 updateFrom XEP-0045 § 8.2:
...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.
- Throws:
java.lang.Exception- when errors occur
-
mucTestPersistentAffiliation
@SmackIntegrationTest public void mucTestPersistentAffiliation() throws java.lang.Exception
Asserts that an affiliation is persistent between visits to the room.From XEP-0045 § 5.2:
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.
- Throws:
java.lang.Exception- when errors occur
-
mucTestModeratorCannotRevokeVoiceFromOwner
@SmackIntegrationTest public void mucTestModeratorCannotRevokeVoiceFromOwner() throws java.lang.Exception
Asserts that a moderator cannot revoke voice from an ownerFrom XEP-0045 § 5.1.1:
A moderator MUST NOT be able to revoke voice privileges from an admin or owner
From XEP-0045 § 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)
- Throws:
java.lang.Exception- when errors occur
-
mucTestModeratorCannotBeRevokedFromHigherAffiliation
@SmackIntegrationTest public void mucTestModeratorCannotBeRevokedFromHigherAffiliation() throws java.lang.Exception
Asserts that a moderator cannot revoke moderator privileges from a moderator with a higher affiliation than themselves.From XEP-0045 § 5.1.3 and §5.2.1:
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)
- Throws:
java.lang.Exception- when errors occur
-
mucTestDefaultRoleForAffiliationInUnmoderatedRoom
@SmackIntegrationTest public void mucTestDefaultRoleForAffiliationInUnmoderatedRoom() throws java.lang.Exception
Asserts that an unmoderated room assigns the correct default roles for a given affiliationFrom XEP-0045 § 5.1.2:
...the initial default roles that a service SHOULD set based on the user's affiliation...
- Throws:
java.lang.Exception- when errors occur
-
mucTestDefaultRoleForAffiliationInModeratedRoom
@SmackIntegrationTest public void mucTestDefaultRoleForAffiliationInModeratedRoom() throws java.lang.Exception
Asserts that a moderated room assigns the correct default roles for a given affiliationFrom XEP-0045 § 5.1.2:
...the initial default roles that a service SHOULD set based on the user's affiliation...
- Throws:
java.lang.Exception- when errors occur
-
mucTestDefaultRoleForAffiliationInMembersOnlyRoom
@SmackIntegrationTest public void mucTestDefaultRoleForAffiliationInMembersOnlyRoom() throws java.lang.Exception
Asserts that a members-only room assigns the correct default roles for a given affiliationFrom XEP-0045 § 5.1.2:
...the initial default roles that a service SHOULD set based on the user's affiliation...
- Throws:
java.lang.Exception- when errors occur
-
-