diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/Configuration.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/Configuration.java index 8135e3deb..b624cf074 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/Configuration.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/Configuration.java @@ -117,6 +117,13 @@ public final class Configuration { public final DnsResolver dnsResolver; + public enum CompatibilityMode { + standardsCompliant, + ejabberd, + } + + public final CompatibilityMode compatibilityMode; + private Configuration(Configuration.Builder builder) throws KeyManagementException, NoSuchAlgorithmException { service = Objects.requireNonNull(builder.service, "'service' must be set. Either via 'properties' files or via system property 'sinttest.service'."); @@ -192,6 +199,7 @@ public final class Configuration { this.verbose = builder.verbose; this.dnsResolver = builder.dnsResolver; + this.compatibilityMode = builder.compatibilityMode; } public boolean isAccountRegistrationPossible() { @@ -246,6 +254,8 @@ public final class Configuration { private DnsResolver dnsResolver = DnsResolver.minidns; + private CompatibilityMode compatibilityMode = CompatibilityMode.standardsCompliant; + private Builder() { } @@ -427,6 +437,20 @@ public final class Configuration { return setDnsResolver(dnsResolver); } + public Builder setCompatibilityMode(CompatibilityMode compatibilityMode) { + this.compatibilityMode = compatibilityMode; + return this; + } + + public Builder setCompatibilityMode(String compatibilityModeString) { + if (compatibilityModeString == null) { + return this; + } + + CompatibilityMode compatibilityMode = CompatibilityMode.valueOf(compatibilityModeString); + return setCompatibilityMode(compatibilityMode); + } + public Configuration build() throws KeyManagementException, NoSuchAlgorithmException { return new Configuration(this); } diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java index db96c7f1e..2010ab146 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java @@ -838,6 +838,16 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs createModeratedMuc(mucAsSeenByOne, nicknameOne); + final MUCRole threeRole; + switch (sinttestConfiguration.compatibilityMode) { + default: + threeRole = MUCRole.visitor; + break; + case ejabberd: + threeRole = MUCRole.participant; + break; + } + try { mucAsSeenByTwo.join(nicknameTwo); mucAsSeenByThree.join(nicknameThree); @@ -849,7 +859,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole()); assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant( JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole()); - assertEquals(MUCRole.visitor, mucAsSeenByOne.getOccupant( + assertEquals(threeRole, mucAsSeenByOne.getOccupant( JidCreate.entityFullFrom(mucAddress, nicknameThree)).getRole()); } finally { tryDestroy(mucAsSeenByOne);