From 282d63da36049746410cfc0462169900e29fd071 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Wed, 10 Jan 2024 10:18:10 +0100
Subject: [PATCH 001/150] [sinttest] Minor fixes in AdHocCommandIntegrationTest
---
.../smackx/commands/AdHocCommandIntegrationTest.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
index b4821f48e..f29f07f91 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2023 Florian Schmaus
+ * Copyright 2023-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
private static DataForm createDataFormOp() {
FormField field = FormField.listSingleBuilder("op")
- .setLabel("Arthimetic Operation")
+ .setLabel("Arithmetic Operation")
.setRequired()
.addOption("+")
.addOption("-")
@@ -118,7 +118,6 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
NextStage.nonFinal).build();
}
- // TODO: Add API for every case where we return null or throw below.
private static Integer extractIntegerField(SubmitForm form, String fieldName) throws XMPPErrorException {
FormField field = form.getField(fieldName);
if (field == null)
From 643d85c5563e276d617107a7ca8832ea6185f138 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Wed, 10 Jan 2024 10:41:22 +0100
Subject: [PATCH 002/150] [xdata] Fix NPE in FillableForm
Calling write() in FillableForm's constructor causes a NPE because
write() makes use of requiredFields which has not been set at this
time. Furthermore, write() makes use of missingRequiredFields, which
is also populated in that loop. Therefore, we have to delay the
invocation of write() until requiredFields got set.
Thanks to Dan Caseley for reporting this.
Reported-by: Dan Caseley
---
.../org/jivesoftware/smackx/xdata/form/FillableForm.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java
index c14990a9a..332c7fc3f 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2020 Florian Schmaus
+ * Copyright 2020-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@ public class FillableForm extends FilledForm {
}
Set requiredFields = new HashSet<>();
+ List requiredFieldsWithDefaultValue = new ArrayList<>();
for (FormField formField : dataForm.getFields()) {
if (formField.isRequired()) {
String fieldName = formField.getFieldName();
@@ -61,13 +62,17 @@ public class FillableForm extends FilledForm {
if (formField.hasValueSet()) {
// This is a form field with a default value.
- write(formField);
+ requiredFieldsWithDefaultValue.add(formField);
} else {
missingRequiredFields.add(fieldName);
}
}
}
this.requiredFields = Collections.unmodifiableSet(requiredFields);
+
+ for (FormField field : requiredFieldsWithDefaultValue) {
+ write(field);
+ }
}
protected void writeListMulti(String fieldName, List extends CharSequence> values) {
From 8b9a9e0f3e11d8a251c01fe68678dfea6c96e05d Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Wed, 10 Jan 2024 10:41:22 +0100
Subject: [PATCH 003/150] [xdata] Fix NPE in FillableForm
Calling write() in FillableForm's constructor causes a NPE because
write() makes use of requiredFields which has not been set at this
time. Furthermore, write() makes use of missingRequiredFields, which
is also populated in that loop. Therefore, we have to delay the
invocation of write() until requiredFields got set.
Thanks to Dan Caseley for reporting this.
Reported-by: Dan Caseley
---
.../org/jivesoftware/smackx/xdata/form/FillableForm.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java
index b40cb92a8..d0657ba08 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/form/FillableForm.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2020 Florian Schmaus
+ * Copyright 2020-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@ public class FillableForm extends FilledForm {
}
Set requiredFields = new HashSet<>();
+ List requiredFieldsWithDefaultValue = new ArrayList<>();
for (FormField formField : dataForm.getFields()) {
if (formField.isRequired()) {
String fieldName = formField.getFieldName();
@@ -62,13 +63,17 @@ public class FillableForm extends FilledForm {
if (formField.hasValueSet()) {
// This is a form field with a default value.
- write(formField);
+ requiredFieldsWithDefaultValue.add(formField);
} else {
missingRequiredFields.add(fieldName);
}
}
}
this.requiredFields = Collections.unmodifiableSet(requiredFields);
+
+ for (FormField field : requiredFieldsWithDefaultValue) {
+ write(field);
+ }
}
protected void writeListMulti(String fieldName, List extends CharSequence> values) {
From 8133505050274bcc9e20fcd04c469d392f880885 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sat, 13 Jan 2024 15:48:29 +0100
Subject: [PATCH 004/150] [websocket] Invoke send listeners
---
.../smack/websocket/XmppWebSocketTransportModule.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java
index 9cfa8fe2f..435373203 100644
--- a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java
+++ b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java
@@ -271,6 +271,7 @@ public final class XmppWebSocketTransportModule
asyncButOrderedOutgoingElementsQueue.performAsyncButOrdered(outgoingElementsQueue, () -> {
for (TopLevelStreamElement topLevelStreamElement; (topLevelStreamElement = outgoingElementsQueue.poll()) != null;) {
websocket.send(topLevelStreamElement);
+ connectionInternal.fireFirstLevelElementSendListeners(topLevelStreamElement);
}
});
}
From e504bc23cfe601e4e414aac1aff54c8f3d69c67f Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Thu, 18 Jan 2024 17:30:44 +0100
Subject: [PATCH 005/150] [extensions] Improve IAE message thrown by
FormFieldRegistry
---
.../jivesoftware/smackx/formtypes/FormFieldRegistry.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/formtypes/FormFieldRegistry.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/formtypes/FormFieldRegistry.java
index 5dda27842..9dae0e1d5 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/formtypes/FormFieldRegistry.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/formtypes/FormFieldRegistry.java
@@ -94,7 +94,13 @@ public class FormFieldRegistry {
} else {
previousType = fieldNameToType.get(fieldName);
if (previousType != null && previousType != fieldType) {
- throw new IllegalArgumentException();
+ String message = "The field '" + fieldName + "' from form type '" + formType
+ + "' was already registered with field type '" + previousType
+ + "' while it is now seen with type '" + fieldType
+ + "'. Form field types have to be unambigiously."
+ + " XMPP uses a registry for form field tpes, scoped by the form type."
+ + " You may find the correct value at https://xmpp.org/registrar/formtypes.html";
+ throw new IllegalArgumentException(message);
}
}
previousType = fieldNameToType.put(fieldName, fieldType);
From a39e5baa741d32af41ac559bbcc7b6233938b725 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Fri, 9 Feb 2024 13:17:36 +0100
Subject: [PATCH 006/150] [socks5] Ignore zone IDs of internet addresses
Fixes SMACK-940.
---
.../smackx/bytestreams/socks5/packet/Bytestream.java | 2 +-
.../jingle_s5b/elements/JingleS5BTransportCandidate.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java
index 64b3ad7d9..a07dd549e 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/packet/Bytestream.java
@@ -295,7 +295,7 @@ public class Bytestream extends IQ {
* @param port port of the stream host.
*/
public StreamHost(final Jid jid, final String address, int port) {
- this(jid, InternetAddress.from(address), port);
+ this(jid, InternetAddress.fromIgnoringZoneId(address), port);
}
public StreamHost(Jid jid, InetAddress address, int port) {
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transports/jingle_s5b/elements/JingleS5BTransportCandidate.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transports/jingle_s5b/elements/JingleS5BTransportCandidate.java
index 4ad96fcca..d3be5a4b3 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transports/jingle_s5b/elements/JingleS5BTransportCandidate.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transports/jingle_s5b/elements/JingleS5BTransportCandidate.java
@@ -51,7 +51,7 @@ public final class JingleS5BTransportCandidate extends JingleContentTransportCan
private final Type type;
public JingleS5BTransportCandidate(String candidateId, String hostString, Jid jid, int port, int priority, Type type) {
- this(candidateId, InternetAddress.from(hostString), jid, port, priority, type);
+ this(candidateId, InternetAddress.fromIgnoringZoneId(hostString), jid, port, priority, type);
}
public JingleS5BTransportCandidate(String candidateId, InternetAddress host, Jid jid, int port, int priority, Type type) {
@@ -176,7 +176,7 @@ public final class JingleS5BTransportCandidate extends JingleContentTransportCan
}
public Builder setHost(String host) {
- InternetAddress inetAddress = InternetAddress.from(host);
+ InternetAddress inetAddress = InternetAddress.fromIgnoringZoneId(host);
return setHost(inetAddress);
}
From f4110ec388c2291fa09d4f6a4cb14bc15806d884 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 10:56:29 +0100
Subject: [PATCH 007/150] SINT: fix typo in output for disabled test
---
.../smack/inttest/SmackIntegrationTestFramework.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index 8be908fb0..a97f96d6c 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -292,7 +292,7 @@ public class SmackIntegrationTestFramework {
}
if (config.isClassDisabled(testClass)) {
- DisabledTestClass disabledTestClass = new DisabledTestClass(testClass, "Skipping test class " + testClassName + " because it is disalbed");
+ DisabledTestClass disabledTestClass = new DisabledTestClass(testClass, "Skipping test class " + testClassName + " because it is disabled");
testRunResult.disabledTestClasses.add(disabledTestClass);
continue;
}
From 449ea732396213095a474f9803c99c38cda0fefa Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 13:14:52 +0100
Subject: [PATCH 008/150] SINT: fix typo in output when using deprecated
'debug' option
---
.../java/org/igniterealtime/smack/inttest/Configuration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 0df16141c..8af128373 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
@@ -517,7 +517,7 @@ public final class Configuration {
String debugString = properties.getProperty("debug");
if (debugString != null) {
- LOGGER.warning("Usage of depreacted 'debug' option detected, please use 'debugger' instead");
+ LOGGER.warning("Usage of deprecated 'debug' option detected, please use 'debugger' instead");
builder.setDebugger(debugString);
}
builder.setDebugger(properties.getProperty("debugger"));
From ec4caf666359adaa776035ebede6633f804ac333 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 13:15:21 +0100
Subject: [PATCH 009/150] SINT: fix typo in validation of accountTwoPassword
argument
---
.../java/org/igniterealtime/smack/inttest/Configuration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 8af128373..73522ee59 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
@@ -315,7 +315,7 @@ public final class Configuration {
this.accountOneUsername = StringUtils.requireNotNullNorEmpty(accountOneUsername, "accountOneUsername must not be null nor empty");
this.accountOnePassword = StringUtils.requireNotNullNorEmpty(accountOnePassword, "accountOnePassword must not be null nor empty");
this.accountTwoUsername = StringUtils.requireNotNullNorEmpty(accountTwoUsername, "accountTwoUsername must not be null nor empty");
- this.accountTwoPassword = StringUtils.requireNotNullNorEmpty(accountTwoPassword, "accountTwoPasswordmust not be null nor empty");
+ this.accountTwoPassword = StringUtils.requireNotNullNorEmpty(accountTwoPassword, "accountTwoPassword must not be null nor empty");
this.accountThreeUsername = StringUtils.requireNotNullNorEmpty(accountThreeUsername, "accountThreeUsername must not be null nor empty");
this.accountThreePassword = StringUtils.requireNotNullNorEmpty(accountThreePassword, "accountThreePassword must not be null nor empty");
return this;
From 806106534d018dc20c324e84f6e94ba18c147e6f Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 13:18:52 +0100
Subject: [PATCH 010/150] SINT: fix various typos in javadoc and comment
---
.../inttest/AbstractSmackLowLevelIntegrationTest.java | 2 +-
.../smack/inttest/SmackIntegrationTestFramework.java | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java
index d517494db..480129575 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackLowLevelIntegrationTest.java
@@ -50,7 +50,7 @@ public abstract class AbstractSmackLowLevelIntegrationTest extends AbstractSmack
* Get a connected connection. Note that this method will return a connection constructed via the default connection
* descriptor. It is primarily meant for integration tests to discover if the XMPP service supports a certain
* feature, that the integration test requires to run. This feature discovery is typically done in the constructor of the
- * integration tests. And if the discovery fails a {@link TestNotPossibleException} should be thrown by he constructor.
+ * integration tests. And if the discovery fails a {@link TestNotPossibleException} should be thrown by the constructor.
*
*
Please ensure that you invoke {@link #recycle(AbstractXMPPConnection connection)} once you are done with this connection.
*
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index a97f96d6c..554a9d849 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -494,7 +494,7 @@ public class SmackIntegrationTestFramework {
return;
}
Throwable nonFatalFailureReason;
- // junit assert's throw an AssertionError if they fail, those should not be
+ // junit asserts throw an AssertionError if they fail, those should not be
// thrown up, as it would be done by throwFatalException()
if (cause instanceof AssertionError) {
nonFatalFailureReason = cause;
@@ -594,8 +594,8 @@ public class SmackIntegrationTestFramework {
throw (InterruptedException) e;
}
- // We handle NullPointerException as a non fatal exception, as they are mostly caused by an invalid reply where
- // a extension element is missing. Consider for example
+ // We handle NullPointerException as a non-fatal exception, as they are mostly caused by an invalid reply where
+ // an extension element is missing. Consider for example
// assertEquals(StanzaError.Condition.foo, response.getError().getCondition())
// Otherwise NPEs could be caused by an internal bug in Smack, e.g. missing null handling.
if (e instanceof NullPointerException) {
@@ -613,9 +613,9 @@ public class SmackIntegrationTestFramework {
public static final class TestRunResult {
/**
- * A short String of lowercase characters and numbers used to identify a integration test
+ * A short String of lowercase characters and numbers used to identify an integration test
* run. We use lowercase characters because this string will eventually be part of the
- * localpart of the used JIDs (and the localpart is case insensitive).
+ * localpart of the used JIDs (and the localpart is case-insensitive).
*/
public final String testRunId = StringUtils.insecureRandomString(5).toLowerCase(Locale.US);
From 84a55fa57e22a5a68af09520b380baec3685d8e9 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 16:17:24 +0100
Subject: [PATCH 011/150] fix typos in package-info
---
.../java/org/igniterealtime/smack/inttest/package-info.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
index 2caf8d792..0db930e4c 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
@@ -249,7 +249,7 @@
* the required XMPP feature. If it does not, simply throw a TestNotPossibleException.
*
*
- * Test methods must be public, take zero arguments i.e. declare no parameters and be annoated with
+ * Test methods must be public, take zero arguments i.e. declare no parameters and be annotated with
* @SmackIntegrationTest. If the test method is not able to perform a test then it should throw a
* TestNotPossibleException.
*
@@ -266,7 +266,7 @@
*
*
Low-Level Integration Tests
*
- * Classes that implement low-level integration tests need to sublcass
+ * Classes that implement low-level integration tests need to subclass
* {@link org.igniterealtime.smack.inttest.AbstractSmackLowLevelIntegrationTest}. The test methods can declare as many
* parameters as they need to, but every parameter must be of type XMPPTCPConnection. The framework will
* automatically create, register and login the connections. After the test is finished, the connections will be
From 92c45e0d29eef8d52897e698a8c00f78c4c68b62 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 21 Mar 2024 16:18:14 +0100
Subject: [PATCH 012/150] sint: Allow use of custom SmackDebugger
Refactors the Smack Integration Test configuration to allow for a classname for a SmackDebugger(Factory) to be
provided.
---
.../smack/inttest/Configuration.java | 38 ++++++++-----------
.../SmackIntegrationTestFramework.java | 9 ++---
.../smack/inttest/package-info.java | 16 +++++++-
3 files changed, 32 insertions(+), 31 deletions(-)
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 0df16141c..3ab8f9e15 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
@@ -36,6 +36,7 @@ import javax.net.ssl.SSLContext;
import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;
import org.jivesoftware.smack.debugger.ConsoleDebugger;
+import org.jivesoftware.smack.debugger.SmackDebuggerFactory;
import org.jivesoftware.smack.util.CollectionUtil;
import org.jivesoftware.smack.util.Function;
import org.jivesoftware.smack.util.Objects;
@@ -61,12 +62,6 @@ public final class Configuration {
serviceAdministration,
}
- public enum Debugger {
- none,
- console,
- enhanced,
- }
-
public enum DnsResolver {
minidns,
javax,
@@ -101,7 +96,7 @@ public final class Configuration {
public final String accountThreePassword;
- public final Debugger debugger;
+ public final SmackDebuggerFactory debuggerFactory;
public final Set enabledTests;
@@ -148,7 +143,7 @@ public final class Configuration {
} else {
replyTimeout = 47000;
}
- debugger = builder.debugger;
+ debuggerFactory = builder.debuggerFactory;
if (StringUtils.isNotEmpty(builder.adminAccountUsername, builder.adminAccountPassword)) {
accountRegistration = AccountRegistration.serviceAdministration;
}
@@ -193,16 +188,8 @@ public final class Configuration {
b.setSecurityMode(securityMode);
b.setXmppDomain(service);
- switch (debugger) {
- case enhanced:
- b.setDebuggerFactory(EnhancedDebugger.Factory.INSTANCE);
- break;
- case console:
- b.setDebuggerFactory(ConsoleDebugger.Factory.INSTANCE);
- break;
- case none:
- // Nothing to do :).
- break;
+ if (debuggerFactory != null) {
+ b.setDebuggerFactory(debuggerFactory);
}
};
@@ -246,7 +233,7 @@ public final class Configuration {
public String accountThreePassword;
- private Debugger debugger = Debugger.none;
+ private SmackDebuggerFactory debuggerFactory;
private Set enabledTests;
@@ -352,18 +339,23 @@ public final class Configuration {
case "false": // For backwards compatibility settings with previous boolean setting.
LOGGER.warning("Debug string \"" + debuggerString + "\" is deprecated, please use \"none\" instead");
case "none":
- debugger = Debugger.none;
+ debuggerFactory = null;
break;
case "true": // For backwards compatibility settings with previous boolean setting.
LOGGER.warning("Debug string \"" + debuggerString + "\" is deprecated, please use \"console\" instead");
case "console":
- debugger = Debugger.console;
+ debuggerFactory = ConsoleDebugger.Factory.INSTANCE;
break;
case "enhanced":
- debugger = Debugger.enhanced;
+ debuggerFactory = EnhancedDebugger.Factory.INSTANCE;
break;
default:
- throw new IllegalArgumentException("Unrecognized debugger string: " + debuggerString);
+ try {
+ final Class extends SmackDebuggerFactory> aClass = Class.forName(debuggerString).asSubclass(SmackDebuggerFactory.class);
+ debuggerFactory = aClass.getConstructor().newInstance();
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Unable to construct debugger from value: " + debuggerString, e);
+ }
}
return this;
}
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index 8be908fb0..aedd55221 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -64,6 +64,7 @@ import org.jivesoftware.smack.util.dns.dnsjava.DNSJavaResolver;
import org.jivesoftware.smack.util.dns.javax.JavaxResolver;
import org.jivesoftware.smack.util.dns.minidns.MiniDnsResolver;
+import org.jivesoftware.smackx.debugger.EnhancedDebugger;
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
import org.jivesoftware.smackx.iqregister.AccountManager;
@@ -138,12 +139,8 @@ public class SmackIntegrationTestFramework {
exitStatus = 0;
}
- switch (config.debugger) {
- case enhanced:
+ if (config.debuggerFactory instanceof EnhancedDebugger) {
EnhancedDebuggerWindow.getInstance().waitUntilClosed();
- break;
- default:
- break;
}
System.exit(exitStatus);
@@ -175,7 +172,7 @@ public class SmackIntegrationTestFramework {
this.connectionManager = new XmppConnectionManager(this);
LOGGER.info("SmackIntegrationTestFramework [" + testRunResult.testRunId + ']' + ": Starting\nSmack version: " + Smack.getVersion());
- if (config.debugger != Configuration.Debugger.none) {
+ if (config.debuggerFactory != null) {
// JUL Debugger will not print any information until configured to print log messages of
// level FINE
// TODO configure JUL for log?
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
index 2caf8d792..46bea2cd0 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
@@ -125,7 +125,7 @@
*
*
*
debugger
- *
‘console’ for console debugger, ‘enhanced’ for the enhanced debugger
+ *
‘console’ for console debugger, ‘enhanced’ for the enhanced debugger, or the name of a class that implements SmackDebuggerFactory for a custom debugger
*
*
*
enabledTests
@@ -284,6 +284,18 @@
* Debug Window launching when your tests launch, and you'll get a stanza-by-stanza account of what happened on each
* connection, hopefully enough to diagnose what went wrong.
*
+ *
+ * Lastly, you can provide a custom debugger, by providing the fully qualified name of a class that implements
+ * {@link org.jivesoftware.smack.debugger.SmackDebuggerFactory}. The provided factory must declare a public constructor
+ * that takes no arguments.
+ *
*/
package org.igniterealtime.smack.inttest;
From 6918663760f2a12134027a2b5e268fa18115436d Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Fri, 9 Feb 2024 14:13:36 +0100
Subject: [PATCH 013/150] [roster] suppress "roster not loaded while processing
presence" if self-presence
Fixes SMACK-941.
---
.../java/org/jivesoftware/smack/roster/Roster.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
index 02ee0d7e1..6c59b1dc7 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
@@ -1534,11 +1534,20 @@ public final class Roster extends Manager {
}
}
+
+ final Jid from = packet.getFrom();
+
if (!isLoaded() && rosterLoadedAtLogin) {
- LOGGER.warning("Roster not loaded while processing " + packet);
+ XMPPConnection connection = connection();
+
+ // Only log the warning, if this is not the reflected self-presence. Otherwise,
+ // the reflected self-presence may cause a spurious warning in case the
+ // connection got quickly shut down. See SMACK-941.
+ if (connection != null && from != null && !from.equals(connection.getUser())) {
+ LOGGER.warning("Roster not loaded while processing " + packet);
+ }
}
final Presence presence = (Presence) packet;
- final Jid from = presence.getFrom();
final BareJid key;
if (from != null) {
From 0ca22f22a9853701ed973e762ef2debd4abf5fa1 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Tue, 2 Apr 2024 18:28:10 +0200
Subject: [PATCH 014/150] Smack 4.4.8
---
CHANGELOG.md | 12 ++++++++++++
version | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d896bc4e4..b413e7f75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
# Smack Changelog
+# 4.4.8 -- 2024-04-02
+
+### Improvement
+
+[SMACK-941](https://igniterealtime.atlassian.net/browse/SMACK-941) Suppress "roster not loaded while processing presence" warning if its caused by the reflected self-presence
+
+### Bug
+
+[SMACK-938](https://igniterealtime.atlassian.net/browse/SMACK-938) Busy loop in SmackReactor
+
+[SMACK-940](https://igniterealtime.atlassian.net/browse/SMACK-940) Ignore IPv6 Zone IDs in incoming streamhost candidates
+
# 4.4.7 -- 2023-11-25
### Improvement
diff --git a/version b/version
index 030279209..f12d1f240 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-4.4.8-SNAPSHOT
+4.4.8
From 951588e4ed3d80222ebb54eec5e4893ea0ec26c7 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Tue, 2 Apr 2024 18:48:17 +0200
Subject: [PATCH 015/150] Smack 4.4.9-SNAPSHOT
---
version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version b/version
index f12d1f240..ebe9667fc 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-4.4.8
+4.4.9-SNAPSHOT
From d92fef432eb85ca1f30f033db5196c1d889f2225 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 21 Mar 2024 14:42:48 +0100
Subject: [PATCH 016/150] SINT: Expose the test that's being executed
---
.../SmackIntegrationTestFramework.java | 35 +++++++++++++++----
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index 8be908fb0..60b39db36 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -87,6 +87,8 @@ public class SmackIntegrationTestFramework {
public static boolean SINTTEST_UNIT_TEST = false;
+ private static ConcreteTest TEST_UNDER_EXECUTION;
+
protected final Configuration config;
protected TestRunResult testRunResult;
@@ -244,6 +246,10 @@ public class SmackIntegrationTestFramework {
return testRunResult;
}
+ public static ConcreteTest getTestUnderExecution() {
+ return TEST_UNDER_EXECUTION;
+ }
+
@SuppressWarnings({"Finally"})
private void runTests(Set> classes)
throws InterruptedException, InstantiationException, IllegalAccessException,
@@ -680,7 +686,12 @@ public class SmackIntegrationTestFramework {
executeSinttestSpecialMethod(beforeClassMethod);
for (ConcreteTest concreteTest : concreteTests) {
- runConcreteTest(concreteTest);
+ TEST_UNDER_EXECUTION = concreteTest;
+ try {
+ runConcreteTest(concreteTest);
+ } finally {
+ TEST_UNDER_EXECUTION = null;
+ }
}
}
finally {
@@ -729,21 +740,33 @@ public class SmackIntegrationTestFramework {
return null;
}
- static final class ConcreteTest {
+ public static final class ConcreteTest {
private final TestType testType;
private final Method method;
private final Executor executor;
- private final String[] subdescriptons;
+ private final List subdescriptons;
private ConcreteTest(TestType testType, Method method, Executor executor, String... subdescriptions) {
this.testType = testType;
this.method = method;
this.executor = executor;
- this.subdescriptons = subdescriptions;
+ this.subdescriptons = List.of(subdescriptions);
}
private transient String stringCache;
+ public TestType getTestType() {
+ return testType;
+ }
+
+ public Method getMethod() {
+ return method;
+ }
+
+ public List getSubdescriptons() {
+ return subdescriptons;
+ }
+
@Override
public String toString() {
if (stringCache != null) {
@@ -756,9 +779,9 @@ public class SmackIntegrationTestFramework {
.append(method.getName())
.append(" (")
.append(testType.name());
- if (subdescriptons != null && subdescriptons.length > 0) {
+ if (!subdescriptons.isEmpty()) {
sb.append(", ");
- StringUtils.appendTo(Arrays.asList(subdescriptons), sb);
+ StringUtils.appendTo(subdescriptons, sb);
}
sb.append(')');
From dc96484d2b46f88352c6a470270337972c6835ae Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Thu, 4 Apr 2024 20:29:32 +0200
Subject: [PATCH 017/150] [sinttest] Add AbstractSmackIntTest.assertResult()
---
.../smack/inttest/AbstractSmackIntTest.java | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
index 2b94b2190..c372103dc 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2015-2020 Florian Schmaus
+ * Copyright 2015-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,10 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.filter.StanzaFilter;
+import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
+
+import org.opentest4j.AssertionFailedError;
+
public abstract class AbstractSmackIntTest {
protected static final Logger LOGGER = Logger.getLogger(AbstractSmackIntTest.class.getName());
@@ -90,4 +94,18 @@ public abstract class AbstractSmackIntTest {
}
return urlConnection;
}
+
+ public R assertResult(ResultSyncPoint syncPoint, String message) throws InterruptedException, TimeoutException, AssertionFailedError {
+ return assertResult(syncPoint, timeout, message);
+ }
+
+ public static R assertResult(ResultSyncPoint syncPoint, long timeout, String message) throws InterruptedException, TimeoutException, AssertionFailedError {
+ try {
+ return syncPoint.waitForResult(timeout);
+ } catch (InterruptedException | TimeoutException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new AssertionFailedError(message, e);
+ }
+ }
}
From f76f0791e60bb4ca01fc426a28fc81a1c55102ce Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 14:01:21 +0100
Subject: [PATCH 018/150] [sinttest] Add tagging of tests with references to
(XMPP) specifications
A new annotation is introduced (`SpecificationReference`) that can be used to annotate a SINT test class
The properties are available in the annotation:
- `document`: Identifier for a specification document, such as 'RFC 6120' or 'XEP-0485'
The pre-existing `SmackIntegrationTest` annotation has now received two new properties:
- `section`: Identifier for a section (or paragraph), such as '6.2.1'
- `quote`: A quotation of relevant text from the section
These are expected to be used in context of the `SpecificationReference` annotation.
The SINT execution framework is modified so that two new configuration options are available:
- `enabledSpecifications`
- `disabledSpecifications`
These operate on the value of the `document` property of the annotation. Their usage is comparable
to that of the pre-existing `enabledTests` and `disabledTest` configuration options.
Execution output now includes the document, section and quote that's on the annotated test, when
the test fails. This allows an end-user to easily correspond a test failure with a particular
specification.
---
.../smack/inttest/Configuration.java | 56 +++++++++++++++++++
.../SmackIntegrationTestFramework.java | 52 +++++++++++++++++
.../annotations/SmackIntegrationTest.java | 14 +++++
.../annotations/SpecificationReference.java | 41 ++++++++++++++
.../smack/inttest/package-info.java | 22 ++++++++
5 files changed, 185 insertions(+)
create mode 100644 smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java
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 0df16141c..eaf54e3ba 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
@@ -111,6 +111,10 @@ public final class Configuration {
private final Map> disabledTestsMap;
+ public final Set enabledSpecifications;
+
+ public final Set disabledSpecifications;
+
public final String defaultConnectionNickname;
public final Set enabledConnections;
@@ -181,6 +185,8 @@ public final class Configuration {
this.enabledTestsMap = convertTestsToMap(enabledTests);
this.disabledTests = CollectionUtil.nullSafeUnmodifiableSet(builder.disabledTests);
this.disabledTestsMap = convertTestsToMap(disabledTests);
+ this.enabledSpecifications = CollectionUtil.nullSafeUnmodifiableSet(builder.enabledSpecifications);
+ this.disabledSpecifications = CollectionUtil.nullSafeUnmodifiableSet(builder.disabledSpecifications);
this.defaultConnectionNickname = builder.defaultConnectionNickname;
this.enabledConnections = builder.enabledConnections;
this.disabledConnections = builder.disabledConnections;
@@ -252,6 +258,10 @@ public final class Configuration {
private Set disabledTests;
+ private Set enabledSpecifications;
+
+ private Set disabledSpecifications;
+
private String defaultConnectionNickname;
private Set enabledConnections;
@@ -378,6 +388,16 @@ public final class Configuration {
return this;
}
+ public Builder setEnabledSpecifications(String enabledSpecificationsString) {
+ enabledSpecifications = getSpecificationSetFrom(enabledSpecificationsString);
+ return this;
+ }
+
+ public Builder setDisabledSpecifications(String disabledSpecificationsString) {
+ disabledSpecifications = getSpecificationSetFrom(disabledSpecificationsString);
+ return this;
+ }
+
public Builder setDefaultConnection(String defaultConnectionNickname) {
this.defaultConnectionNickname = defaultConnectionNickname;
return this;
@@ -523,6 +543,8 @@ public final class Configuration {
builder.setDebugger(properties.getProperty("debugger"));
builder.setEnabledTests(properties.getProperty("enabledTests"));
builder.setDisabledTests(properties.getProperty("disabledTests"));
+ builder.setEnabledSpecifications(properties.getProperty("enabledSpecifications"));
+ builder.setDisabledSpecifications(properties.getProperty("disabledSpecifications"));
builder.setDefaultConnection(properties.getProperty("defaultConnection"));
builder.setEnabledConnections(properties.getProperty("enabledConnections"));
builder.setDisabledConnections(properties.getProperty("disabledConnections"));
@@ -587,6 +609,10 @@ public final class Configuration {
});
}
+ private static Set getSpecificationSetFrom(String input) {
+ return split(input, Configuration::normalizeSpecification);
+ }
+
private static Map> convertTestsToMap(Set tests) {
Map> res = new HashMap<>();
for (String test : tests) {
@@ -695,4 +721,34 @@ public final class Configuration {
return contains(method, disabledTestsMap);
}
+ public boolean isSpecificationEnabled(String specification) {
+ if (enabledSpecifications.isEmpty()) {
+ return true;
+ }
+
+ if (specification == null) {
+ return false;
+ }
+
+ return enabledSpecifications.contains(normalizeSpecification(specification));
+ }
+
+ public boolean isSpecificationDisabled(String specification) {
+ if (disabledSpecifications.isEmpty()) {
+ return false;
+ }
+
+ if (specification == null) {
+ return false;
+ }
+
+ return disabledSpecifications.contains(normalizeSpecification(specification));
+ }
+
+ static String normalizeSpecification(String specification) {
+ if (specification == null || specification.isBlank()) {
+ return null;
+ }
+ return specification.replaceAll("\\s", "").toUpperCase();
+ }
}
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index 8be908fb0..63e47bf0b 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -44,6 +44,8 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -71,6 +73,7 @@ import org.igniterealtime.smack.inttest.Configuration.AccountRegistration;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.reflections.Reflections;
import org.reflections.scanners.MethodAnnotationsScanner;
import org.reflections.scanners.MethodParameterScanner;
@@ -128,10 +131,21 @@ public class SmackIntegrationTestFramework {
final int exitStatus;
if (failedTests > 0) {
LOGGER.warning("💀 The following " + failedTests + " tests failed! 💀");
+ final SortedSet bySpecification = new TreeSet<>();
for (FailedTest failedTest : testRunResult.failedIntegrationTests) {
final Throwable cause = failedTest.failureReason;
LOGGER.log(Level.SEVERE, failedTest.concreteTest + " failed: " + cause, cause);
+ if (failedTest.concreteTest.method.isAnnotationPresent(SpecificationReference.class)) {
+ final String specificationReference = getSpecificationReference(failedTest.concreteTest.method);
+ if (specificationReference != null) {
+ bySpecification.add("- " + specificationReference + " (as tested by '" + failedTest.concreteTest + "')");
+ }
+ }
}
+ if (!bySpecification.isEmpty()) {
+ LOGGER.log(Level.SEVERE, "The failed tests correspond to the following specifications:" + System.lineSeparator() + String.join(System.lineSeparator(), bySpecification));
+ }
+
exitStatus = 2;
} else {
LOGGER.info("All possible Smack Integration Tests completed successfully. \\o/");
@@ -149,6 +163,24 @@ public class SmackIntegrationTestFramework {
System.exit(exitStatus);
}
+ private static String getSpecificationReference(Method method) {
+ final SpecificationReference spec = method.getDeclaringClass().getAnnotation(SpecificationReference.class);
+ if (spec == null || spec.document().isBlank()) {
+ return null;
+ }
+ String line = spec.document().trim();
+
+ final SmackIntegrationTest test = method.getAnnotation(SmackIntegrationTest.class);
+ if (!test.section().isBlank()) {
+ line += " section " + test.section().trim();
+ }
+ if (!test.quote().isBlank()) {
+ line += ":\t\"" + test.quote().trim() + "\"";
+ }
+ assert !line.isBlank();
+ return line;
+ }
+
public SmackIntegrationTestFramework(Configuration configuration) {
this.config = configuration;
}
@@ -297,6 +329,26 @@ public class SmackIntegrationTestFramework {
continue;
}
+ final String specification;
+ if (testClass.isAnnotationPresent(SpecificationReference.class)) {
+ final SpecificationReference specificationReferenceAnnotation = testClass.getAnnotation(SpecificationReference.class);
+ specification = Configuration.normalizeSpecification(specificationReferenceAnnotation.document());
+ } else {
+ specification = null;
+ }
+
+ if (!config.isSpecificationEnabled(specification)) {
+ DisabledTestClass disabledTestClass = new DisabledTestClass(testClass, "Skipping test method " + testClass + " because it tests a specification ('" + specification + "') that is not enabled");
+ testRunResult.disabledTestClasses.add(disabledTestClass);
+ continue;
+ }
+
+ if (config.isSpecificationDisabled(specification)) {
+ DisabledTestClass disabledTestClass = new DisabledTestClass(testClass, "Skipping test method " + testClass + " because it tests a specification ('" + specification + "') that is disabled");
+ testRunResult.disabledTestClasses.add(disabledTestClass);
+ continue;
+ }
+
final Constructor extends AbstractSmackIntTest> cons;
try {
cons = testClass.getConstructor(SmackIntegrationTestEnvironment.class);
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SmackIntegrationTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SmackIntegrationTest.java
index 173b4d2e9..55b1ef684 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SmackIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SmackIntegrationTest.java
@@ -31,4 +31,18 @@ public @interface SmackIntegrationTest {
int connectionCount() default -1;
+ /**
+ * Unique identifier for a section (or paragraph) of the document referenced by {@link SpecificationReference},
+ * such as '6.2.1'.
+ *
+ * @return a document section identifier
+ */
+ String section() default "";
+
+ /**
+ * A quotation of relevant text from the section referenced by {@link #section()}.
+ *
+ * @return human-readable text from the references document and section.
+ */
+ String quote() default "";
}
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java
new file mode 100644
index 000000000..947dc3b90
--- /dev/null
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/annotations/SpecificationReference.java
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2024 Guus der Kinderen
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.igniterealtime.smack.inttest.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Reference to a specific part of a specification.
+ *
+ * @author Guus der Kinderen, guus@goodbytes.nl
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface SpecificationReference {
+
+ /**
+ * Unique identifier for a specification document, such as 'RFC 6120' or 'XEP-0485'.
+ *
+ * @return a document identifier
+ */
+ String document();
+}
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
index 2caf8d792..a6692a5c0 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
@@ -136,6 +136,14 @@
*
List of disabled tests
*
*
+ *
enabledSpecifications
+ *
List of specifications for which to enable tests
+ *
+ *
+ *
disabledSpecifications
+ *
List of specificatinos for which to disable tests
+ *
+ *
*
defaultConnection
*
Nickname of the default connection
*
@@ -187,6 +195,20 @@
*
* would run all tests defined in the SoftwareInfoIntegrationTest class.
*
+ *
+ * Use enabledSpecifications to run all tests that assert implementation of functionality that is described
+ * in standards identified by the provided specification-reference.
+ *
+ * would run all tests that are annotated to verify functionality specified in XEP-0045: "Multi-User Chat".
+ *
*
Overview of the components
*
* Package org.igniterealtime.smack.inttest
From 8839808746107b52348be1d827e27fa149ceace1 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 14 Mar 2024 14:11:40 +0100
Subject: [PATCH 019/150] [sinttest] Retrofit most pre-existing tests to use
new tagging
This applies the new features from the previous commit, and applies them to pre-existing tests.
---
.../smackx/caps/EntityCapsTest.java | 2 +
.../chatstate/ChatStateIntegrationTest.java | 2 +
.../commands/AdHocCommandIntegrationTest.java | 2 +
.../FileTransferIntegrationTest.java | 2 +
.../GeolocationIntegrationTest.java | 2 +
.../HttpFileUploadIntegrationTest.java | 2 +
.../smackx/iot/IoTControlIntegrationTest.java | 2 +
.../smackx/iot/IoTDataIntegrationTest.java | 2 +
.../iot/IoTDiscoveryIntegrationTest.java | 2 +
.../iqversion/VersionIntegrationTest.java | 2 +
.../smackx/mam/MamIntegrationTest.java | 2 +
.../smackx/mood/MoodIntegrationTest.java | 2 +
.../MultiUserChatEntityIntegrationTest.java | 62 ++--
.../muc/MultiUserChatIntegrationTest.java | 40 +--
.../MultiUserChatLowLevelIntegrationTest.java | 2 +
...AffiliationsPrivilegesIntegrationTest.java | 291 ++++++------------
.../MessageEncryptionIntegrationTest.java | 2 +
.../smackx/omemo/OmemoMamDecryptionTest.java | 2 +
.../omemo/ReadOnlyDeviceIntegrationTest.java | 2 +
.../SessionRenegotiationIntegrationTest.java | 2 +
.../ox/OXSecretKeyBackupIntegrationTest.java | 4 +-
.../OXInstantMessagingIntegrationTest.java | 2 +
.../smackx/ping/PingIntegrationTest.java | 2 +
.../smackx/pubsub/PubSubIntegrationTest.java | 17 +-
.../SoftwareInfoIntegrationTest.java | 2 +
.../usertune/UserTuneIntegrationTest.java | 2 +
26 files changed, 176 insertions(+), 280 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java
index 4c373a9ce..bcf23f627 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java
@@ -51,7 +51,9 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+@SpecificationReference(document = "XEP-0115")
public class EntityCapsTest extends AbstractSmackIntegrationTest {
private final EntityCapsManager ecmTwo;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java
index 11e1340f4..fad509c4c 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java
@@ -27,8 +27,10 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
+@SpecificationReference(document = "XEP-0085")
public class ChatStateIntegrationTest extends AbstractSmackIntegrationTest {
// Listener for composing chat state
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
index f29f07f91..6d37399d8 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
@@ -36,7 +36,9 @@ import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+@SpecificationReference(document = "XEP-0050")
public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
public AdHocCommandIntegrationTest(SmackIntegrationTestEnvironment environment) {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java
index ac79e46ec..023959539 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java
@@ -31,8 +31,10 @@ import org.jivesoftware.smackx.filetransfer.FileTransfer.Status;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
+@SpecificationReference(document = "XEP-0096")
public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
private static final int MAX_FT_DURATION = 360;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java
index 7e149ff3b..a67a3ee03 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java
@@ -34,11 +34,13 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.junit.jupiter.api.Assertions;
import org.jxmpp.util.XmppDateTime;
+@SpecificationReference(document = "XEP-0080")
public class GeolocationIntegrationTest extends AbstractSmackIntegrationTest {
private final GeoLocationManager glm1;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java
index 243bfec36..a823e03ad 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java
@@ -36,7 +36,9 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+@SpecificationReference(document = "XEP-0363")
public class HttpFileUploadIntegrationTest extends AbstractSmackIntegrationTest {
private static final int FILE_SIZE = 1024 * 128;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java
index 498493b5b..1cbf4f2a9 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java
@@ -33,10 +33,12 @@ import org.jivesoftware.smackx.iot.control.element.SetData;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.jxmpp.jid.Jid;
+@SpecificationReference(document = "XEP-0347")
public class IoTControlIntegrationTest extends AbstractSmackIntegrationTest {
private final IoTControlManager IoTControlManagerOne;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java
index 858eae9a7..c95209cdb 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java
@@ -37,8 +37,10 @@ import org.jivesoftware.smackx.iot.data.element.TimestampElement;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
+@SpecificationReference(document = "XEP-0347")
public class IoTDataIntegrationTest extends AbstractSmackIntegrationTest {
private final IoTDataManager iotDataManagerOne;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java
index df6bf345e..3ef48c837 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java
@@ -34,8 +34,10 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.jxmpp.jid.Jid;
+@SpecificationReference(document = "XEP-0347")
public class IoTDiscoveryIntegrationTest extends AbstractSmackIntegrationTest {
private final IoTDiscoveryManager discoveryManagerOne;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java
index 9e903bbb8..c12ea5370 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java
@@ -28,7 +28,9 @@ import org.jivesoftware.smackx.iqversion.packet.Version;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+@SpecificationReference(document = "XEP-0092")
public class VersionIntegrationTest extends AbstractSmackIntegrationTest {
public VersionIntegrationTest(SmackIntegrationTestEnvironment environment) {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java
index 046a33ac6..b9fcbea7e 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java
@@ -42,9 +42,11 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.jxmpp.jid.EntityBareJid;
+@SpecificationReference(document = "XEP-0313")
public class MamIntegrationTest extends AbstractSmackIntegrationTest {
private final MamManager mamManagerConTwo;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java
index 1a83085dc..bdfaa520e 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java
@@ -30,10 +30,12 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.junit.jupiter.api.Assertions;
+@SpecificationReference(document = "XEP-0107")
public class MoodIntegrationTest extends AbstractSmackIntegrationTest {
private final MoodManager mm1;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
index 279160c0f..edf71b0a2 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
@@ -34,10 +34,12 @@ import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.parts.Resourcepart;
+@SpecificationReference(document = "XEP-0045")
public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatIntegrationTest {
public MultiUserChatEntityIntegrationTest(SmackIntegrationTestEnvironment environment)
@@ -47,18 +49,14 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
}
/**
- * Asserts that a MUC service can have its features discovered
- *
- *
From XEP-0045 § 6.2:
- *
- * An entity may wish to discover if a service implements the Multi-User Chat protocol; in order to do so, it
- * sends a service discovery information ("disco#info") query to the MUC service's JID. The service MUST return
- * its identity and the features it supports.
- *
+ * Asserts that a MUC service can have its features discovered.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "6.2", quote =
+ "An entity may wish to discover if a service implements the Multi-User Chat protocol; in order to do so, it " +
+ "sends a service discovery information (\"disco#info\") query to the MUC service's JID. The service MUST " +
+ "return its identity and the features it supports.")
public void mucTestForDiscoveringFeatures() throws Exception {
DiscoverInfo info = mucManagerOne.getMucServiceDiscoInfo(mucManagerOne.getMucServiceDomains().get(0));
assertTrue(info.getIdentities().size() > 0);
@@ -68,17 +66,13 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
/**
* Asserts that a MUC Service lists its public rooms.
*
- *
From XEP-0045 § 6.3:
- *
- * The service discovery items ("disco#items") protocol enables an entity to query a service for a list of
- * associated items, which in the case of a chat service would consist of the specific chat rooms hosted by the
- * service. The service SHOULD return a full list of the public rooms it hosts (i.e., not return any rooms that
- * are hidden).
- *
- *
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "6.3", quote =
+ "The service discovery items (\"disco#items\") protocol enables an entity to query a service for a list of " +
+ "associated items, which in the case of a chat service would consist of the specific chat rooms hosted by the" +
+ "service. The service SHOULD return a full list of the public rooms it hosts (i.e., not return any rooms that" +
+ "are hidden).")
public void mucTestForDiscoveringRooms() throws Exception {
EntityBareJid mucAddressPublic = getRandomRoom("smack-inttest-publicroom");
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddressPublic);
@@ -104,15 +98,11 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
/**
* Asserts that a MUC Service returns disco info for a room.
*
- *
From XEP-0045 § 6.4:
- *
- * Using the disco#info protocol, an entity may also query a specific chat room for more detailed information
- * about the room....The room MUST return its identity and SHOULD return the features it supports
- *
- *
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "6.4", quote =
+ "Using the disco#info protocol, an entity may also query a specific chat room for more detailed information " +
+ "about the room....The room MUST return its identity and SHOULD return the features it supports")
public void mucTestForDiscoveringRoomInfo() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-discoinfo");
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
@@ -133,16 +123,12 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
/**
* Asserts that a MUC Service returns disco info for a room's items.
*
- *
From XEP-0045 § 6.5:
- *
- * An entity MAY also query a specific chat room for its associated items. An implementation MAY return a list
- * of existing occupants if that information is publicly available, or return no list at all if this information is
- * kept private.
- *
- *
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "6.5", quote =
+ "An entity MAY also query a specific chat room for its associated items. An implementation MAY return a list " +
+ "of existing occupants if that information is publicly available, or return no list at all if this " +
+ "information is kept private.")
public void mucTestForDiscoveringRoomItems() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-discoitems");
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
@@ -162,15 +148,11 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
* Asserts that a non-occupant receives a Bad Request error when attempting to query an occupant by their
* occupant JID.
*
- *
From XEP-0045 § 6.6:
- *
- * If a non-occupant attempts to send a disco request to an address of the form <room@service/nick>, a MUC service
- * MUST return a <bad-request/> error
- *
- *
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "6.6", quote =
+ "If a non-occupant attempts to send a disco request to an address of the form , a MUC " +
+ "service MUST return a error")
public void mucTestForRejectingDiscoOnRoomOccupantByNonOccupant() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-discoitems");
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
index 36fa47815..c6e4e9209 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
@@ -34,11 +34,13 @@ import org.jivesoftware.smackx.muc.packet.MUCUser;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.parts.Resourcepart;
+@SpecificationReference(document = "XEP-0045")
public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrationTest {
public MultiUserChatIntegrationTest(SmackIntegrationTestEnvironment environment)
@@ -50,15 +52,11 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
/**
* Asserts that when a user joins a room, they are themselves included on the list of users notified (self-presence).
*
- *
From XEP-0045 § 7.2.2:
- *
- * ...the service MUST also send presence from the new participant's occupant JID to the full JIDs of all the
- * occupants (including the new occupant)
- *
- *
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "7.2.2", quote =
+ "... the service MUST also send presence from the new participant's occupant JID to the full JIDs of all the " +
+ "occupants (including the new occupant)")
public void mucJoinTest() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-join");
@@ -80,16 +78,12 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
/**
* Asserts that when a user leaves a room, they are themselves included on the list of users notified (self-presence).
*
- *
From XEP-0045 § 7.14:
- *
- * The service MUST then send a presence stanzas of type "unavailable" from the departing user's occupant JID to
- * the departing occupant's full JIDs, including a status code of "110" to indicate that this notification is
- * "self-presence"
- *
- *
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "7.14", quote =
+ "The service MUST then send a presence stanzas of type \"unavailable\" from the departing user's occupant " +
+ "JID to the departing occupant's full JIDs, including a status code of \"110\" to indicate that this " +
+ "notification is \"self-presence\"")
public void mucLeaveTest() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-leave");
@@ -144,18 +138,15 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
}
- /**
- * Asserts that a user is notified when a room is destroyed
- *
- *
From XEP-0045 § 10.9:
- *
- * A room owner MUST be able to destroy a room, especially if the room is persistent... The room removes all users from the room... and destroys the room
- *
+ /**
+ * Asserts that a user is notified when a room is destroyed.
*
* @throws TimeoutException when roomDestroyed event doesn't get fired
* @throws Exception when other errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "10.9", quote =
+ "A room owner MUST be able to destroy a room, especially if the room is persistent... The room removes all " +
+ "users from the room... and destroys the room")
public void mucDestroyTest() throws TimeoutException, Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-destroy");
@@ -190,7 +181,4 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
assertEquals(0, muc.getOccupantsCount());
assertNull(muc.getNickname());
}
-
-
-
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java
index e0f476306..7cc418b2c 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java
@@ -33,11 +33,13 @@ import org.igniterealtime.smack.inttest.AbstractSmackLowLevelIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Localpart;
import org.jxmpp.jid.parts.Resourcepart;
+@SpecificationReference(document = "XEP-0048")
public class MultiUserChatLowLevelIntegrationTest extends AbstractSmackLowLevelIntegrationTest {
public MultiUserChatLowLevelIntegrationTest(SmackIntegrationTestEnvironment environment) throws Exception {
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 d26e22593..b4259bae1 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
@@ -32,6 +32,7 @@ import org.jivesoftware.smackx.muc.packet.MUCUser;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid;
@@ -40,6 +41,7 @@ import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart;
+@SpecificationReference(document = "XEP-0045")
public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends AbstractMultiUserChatIntegrationTest{
public MultiUserChatRolesAffiliationsPrivilegesIntegrationTest(SmackIntegrationTestEnvironment environment)
@@ -49,23 +51,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who undergoes a role change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who undergoes a role change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "5.1.3", quote =
+ "(§ 5.1.3)... a MUC service implementation MUST change the occupant's role to reflect the change and " +
+ "communicate the change to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -97,23 +90,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who is present when another user undergoes a role change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "9.6", quote =
+ "(§ 5.1.3)... a MUC service implementation MUST change the occupant's role to reflect the change and " +
+ "communicate the change to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -146,23 +130,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who undergoes a role change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who undergoes a role change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "5.1.3", quote =
+ "(§ 5.1.3)... a MUC service implementation MUST change the occupant's role to reflect the change and " +
+ "communicate the change to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -192,23 +167,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who is present when another user undergoes a role change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "9.7", quote =
+ "(§ 5.1.3)... a MUC service implementation MUST change the occupant's role to reflect the change and " +
+ "communicate the change to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -241,23 +207,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user in an unmoderated room who undergoes an afilliation change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user in an unmoderated room who undergoes an afilliation change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "5.1.3", quote =
+ "(§ 5.1.3)... a MUC service implementation MUST change the occupant's role to reflect the change and " +
+ "communicate the change to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -285,23 +242,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who is present when another user undergoes a role change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who is present when another user undergoes a role change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "8.4", quote =
+ "(§ 5.1.3)... a MUC service implementation MUST change the occupant's role to reflect the change and " +
+ "communicate the change to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -333,23 +281,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who undergoes an affiliation change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who undergoes an affiliation change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "5.2.2", quote =
+ "(§ 5.2.2) ... a MUC service implementation MUST change the user's affiliation to reflect the change and " +
+ "communicate that to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -381,23 +320,14 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
/**
* Asserts that a user who is present when another user undergoes an affiliation change receives that change as a
- * presence update
- *
- *
From 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...
- *
+ * presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "10.6", quote =
+ "(§ 5.2.2) ... a MUC service implementation MUST change the user's affiliation to reflect the change and " +
+ "communicate that to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -429,23 +359,15 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who undergoes an affiliation change receives that change as a presence update
- *
- *
From 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...
- *
+ * Asserts that a user who undergoes an affiliation change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "10.7", quote =
+ "(§ 5.2.2) ... a MUC service implementation MUST change the user's affiliation to reflect the change and " +
+ "communicate that to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -491,7 +413,11 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "10.7", quote =
+ "(§ 5.2.2) ... a MUC service implementation MUST change the user's affiliation to reflect the change and " +
+ "communicate that to all occupants [...] (§ 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -524,21 +450,16 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who gets kicked receives that change as a presence update
- *
- *
From 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.
- *
+ * Asserts that a user who gets kicked receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -572,19 +493,15 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user who is present when another user gets kicked receives that change as a presence update
- *
- *
From 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.
- *
+ * Asserts that a user who is present when another user gets kicked receives that change as a presence update.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 " +
+ "() 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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -624,16 +541,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
/**
* 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 Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -665,24 +578,16 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a moderator cannot revoke voice from an owner
- *
- *
From 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)
- *
+ * Asserts that a moderator cannot revoke voice from an owner.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "5.1.1", quote =
+ "A moderator MUST NOT be able to revoke voice privileges from an admin or owner [...] (§ 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 error to the sender along with the offending item(s)")
public void mucTestModeratorCannotRevokeVoiceFromOwner() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -708,16 +613,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
* 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 Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest");
@@ -755,16 +656,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that an unmoderated room assigns the correct default roles for a given affiliation
- *
- *
From XEP-0045 § 5.1.2:
- *
- * ...the initial default roles that a service SHOULD set based on the user's affiliation...
- *
+ * Asserts that an unmoderated room assigns the correct default roles for a given affiliation.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-unmoderatedroles");
@@ -804,16 +701,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a moderated room assigns the correct default roles for a given affiliation
- *
- *
From XEP-0045 § 5.1.2:
- *
- * ...the initial default roles that a service SHOULD set based on the user's affiliation...
- *
+ * Asserts that a moderated room assigns the correct default roles for a given affiliation.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-moderatedroles");
@@ -864,16 +757,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a members-only room assigns the correct default roles for a given affiliation
- *
- *
From XEP-0045 § 5.1.2:
- *
- * ...the initial default roles that a service SHOULD set based on the user's affiliation...
- *
+ * Asserts that a members-only room assigns the correct default roles for a given affiliation.
*
* @throws Exception when errors occur
*/
- @SmackIntegrationTest
+ @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 Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-membersonlyroles");
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/MessageEncryptionIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/MessageEncryptionIntegrationTest.java
index 2efd1fb1a..a8d5fe441 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/MessageEncryptionIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/MessageEncryptionIntegrationTest.java
@@ -29,12 +29,14 @@ import org.jivesoftware.smackx.omemo.element.OmemoBundleElement;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
/**
* Simple OMEMO message encryption integration test.
* During this test Alice sends an encrypted message to Bob. Bob decrypts it and sends a response to Alice.
* It is checked whether the messages can be decrypted, and if used up pre-keys result in renewed bundles.
*/
+@SpecificationReference(document = "XEP-0384")
public class MessageEncryptionIntegrationTest extends AbstractTwoUsersOmemoIntegrationTest {
public MessageEncryptionIntegrationTest(SmackIntegrationTestEnvironment environment)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java
index 442643071..489dee26c 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java
@@ -35,11 +35,13 @@ import org.jivesoftware.smackx.omemo.util.MessageOrOmemoMessage;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
/**
* This test sends a message from Alice to Bob, while Bob has automatic decryption disabled.
* Then Bob fetches his Mam archive and decrypts the result.
*/
+@SpecificationReference(document = "XEP-0384")
public class OmemoMamDecryptionTest extends AbstractTwoUsersOmemoIntegrationTest {
public OmemoMamDecryptionTest(SmackIntegrationTestEnvironment environment)
throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException,
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/ReadOnlyDeviceIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/ReadOnlyDeviceIntegrationTest.java
index 94c671962..ee593c012 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/ReadOnlyDeviceIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/ReadOnlyDeviceIntegrationTest.java
@@ -32,7 +32,9 @@ import org.jivesoftware.smackx.omemo.exceptions.UndecidedOmemoIdentityException;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+@SpecificationReference(document = "XEP-0384")
public class ReadOnlyDeviceIntegrationTest extends AbstractTwoUsersOmemoIntegrationTest {
public ReadOnlyDeviceIntegrationTest(SmackIntegrationTestEnvironment environment) throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, TestNotPossibleException {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/SessionRenegotiationIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/SessionRenegotiationIntegrationTest.java
index c4a649911..e8a48fd7b 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/SessionRenegotiationIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/SessionRenegotiationIntegrationTest.java
@@ -24,7 +24,9 @@ import org.jivesoftware.smack.packet.MessageBuilder;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+@SpecificationReference(document = "XEP-0384")
public class SessionRenegotiationIntegrationTest extends AbstractTwoUsersOmemoIntegrationTest {
public SessionRenegotiationIntegrationTest(SmackIntegrationTestEnvironment environment)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java
index 60e3361ad..dc64db3a9 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java
@@ -48,9 +48,11 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.protection.UnprotectedKeysProtector;
+@SpecificationReference(document = "XEP-0374")
public class OXSecretKeyBackupIntegrationTest extends AbstractOpenPgpIntegrationTest {
private static final String sessionId = StringUtils.randomString(10);
@@ -101,7 +103,7 @@ public class OXSecretKeyBackupIntegrationTest extends AbstractOpenPgpIntegration
org.apache.commons.io.FileUtils.deleteDirectory(beforePath);
}
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "5")
public void test() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException,
NoSuchProviderException, IOException, InterruptedException, PubSubException.NotALeafNodeException,
SmackException.NoResponseException, SmackException.NotConnectedException, XMPPException.XMPPErrorException,
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java
index 683bc199a..cb5e914af 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java
@@ -39,11 +39,13 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.pgpainless.decryption_verification.OpenPgpMetadata;
import org.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.protection.UnprotectedKeysProtector;
+@SpecificationReference(document = "XEP-0374")
public class OXInstantMessagingIntegrationTest extends AbstractOpenPgpIntegrationTest {
private static final String sessionId = StringUtils.randomString(10);
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java
index 65c683093..035b9ed32 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java
@@ -35,8 +35,10 @@ import org.jivesoftware.smack.XMPPConnection;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.jxmpp.jid.Jid;
+@SpecificationReference(document = "XEP-0199")
public class PingIntegrationTest extends AbstractSmackIntegrationTest {
public PingIntegrationTest(SmackIntegrationTestEnvironment environment) {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
index 1890caf2d..4e2377c26 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
@@ -34,8 +34,10 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.jxmpp.jid.DomainBareJid;
+@SpecificationReference(document = "XEP-0060")
public class PubSubIntegrationTest extends AbstractSmackIntegrationTest {
private final PubSubManager pubSubManagerOne;
@@ -82,21 +84,10 @@ public class PubSubIntegrationTest extends AbstractSmackIntegrationTest {
}
}
- /**
-
- */
-
/**
* Asserts that an error is returned when a publish request to a node that is both
* 'notification-only' as well as 'transient' contains an item element.
*
- *
From XEP-0060 § 7.1.3.6:
- *
- * If the event type is notification + transient and the publisher provides an item,
- * the service MUST bounce the publication request with a <bad-request/> error
- * and a pubsub-specific error condition of <item-forbidden/>.
- *
- *
* @throws NoResponseException if there was no response from the remote entity.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NotConnectedException if the XMPP connection is not connected.
@@ -104,7 +95,9 @@ public class PubSubIntegrationTest extends AbstractSmackIntegrationTest {
* @see
* 7.1.3.6 Request Does Not Match Configuration
*/
- @SmackIntegrationTest
+ @SmackIntegrationTest(section = "7.1.3.6", quote =
+ "If the event type is notification + transient and the publisher provides an item, the service MUST bounce " +
+ "the publication request with a error and a pubsub-specific error condition of .")
public void transientNotificationOnlyNodeWithItemTest() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
final String nodename = "sinttest-transient-notificationonly-withitem-nodename-" + testRunId;
final String itemId = "sinttest-transient-notificationonly-withitem-itemid-" + testRunId;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java
index 3bf111f53..64374e173 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java
@@ -33,8 +33,10 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
+@SpecificationReference(document = "XEP-0232")
public class SoftwareInfoIntegrationTest extends AbstractSmackIntegrationTest {
public final SoftwareInfoManager sim1;
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java
index 653bded72..db3275d00 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java
@@ -32,10 +32,12 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.junit.jupiter.api.Assertions;
+@SpecificationReference(document = "XEP-0118")
public class UserTuneIntegrationTest extends AbstractSmackIntegrationTest {
private final UserTuneManager utm1;
From 2298364384c38b43f1dbc0c6dc8d9f7ffb40c510 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Fri, 5 Apr 2024 16:51:26 +0200
Subject: [PATCH 020/150] [sinttest] Assertions to have human readable messages
This adds human-readable text to nearly all assertions in SINT. It is intended that these, together with an XMPP dump of the traffic that was exchanged during the test, allows an observer to have a chance to determine why a particular test failed, without analyzing the test code itself.
---
.../smack/LoginIntegrationTest.java | 3 +-
.../smack/StreamManagementTest.java | 13 +-
.../WaitForClosingStreamElementTest.java | 2 +-
.../smack/roster/RosterIntegrationTest.java | 13 +-
.../smackx/caps/EntityCapsTest.java | 29 +--
.../chatstate/ChatStateIntegrationTest.java | 2 +-
.../commands/AdHocCommandIntegrationTest.java | 18 +-
.../FileTransferIntegrationTest.java | 10 +-
.../GeolocationIntegrationTest.java | 24 +--
.../HttpFileUploadIntegrationTest.java | 2 +-
.../smackx/iot/IoTControlIntegrationTest.java | 2 +-
.../smackx/iot/IoTDataIntegrationTest.java | 14 +-
.../iot/IoTDiscoveryIntegrationTest.java | 2 +-
.../iqversion/VersionIntegrationTest.java | 4 +-
.../smackx/mam/MamIntegrationTest.java | 24 +--
.../smackx/mood/MoodIntegrationTest.java | 18 +-
.../MultiUserChatEntityIntegrationTest.java | 24 +--
.../muc/MultiUserChatIntegrationTest.java | 39 ++--
.../MultiUserChatLowLevelIntegrationTest.java | 2 +-
...AffiliationsPrivilegesIntegrationTest.java | 166 ++++++++++--------
.../AbstractTwoUsersOmemoIntegrationTest.java | 12 +-
.../smackx/omemo/OmemoMamDecryptionTest.java | 7 +-
.../smackx/pubsub/PubSubIntegrationTest.java | 6 +-
.../SoftwareInfoIntegrationTest.java | 3 +-
.../usertune/UserTuneIntegrationTest.java | 10 +-
25 files changed, 230 insertions(+), 219 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java
index 2c9dbb9ec..63704c2c2 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java
@@ -64,7 +64,8 @@ public class LoginIntegrationTest extends AbstractSmackLowLevelIntegrationTest {
() -> connection.login(nonExistentUserString, invalidPassword));
SaslNonza.SASLFailure saslFailure = saslErrorException.getSASLFailure();
- assertEquals(SASLError.not_authorized, saslFailure.getSASLError());
+ assertEquals(SASLError.not_authorized, saslFailure.getSASLError(),
+ "Expected the server to return the appropriate SASL failure condition (but it did not)");
} finally {
connection.disconnect();
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java
index c9ca9095b..78d075af3 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java
@@ -32,6 +32,7 @@ import org.igniterealtime.smack.inttest.AbstractSmackSpecificLowLevelIntegration
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.jxmpp.jid.EntityFullJid;
public class StreamManagementTest extends AbstractSmackSpecificLowLevelIntegrationTest {
@@ -57,7 +58,7 @@ public class StreamManagementTest extends AbstractSmackSpecificLowLevelIntegrati
try {
send(body1, conOne, conTwo);
- assertMessageWithBodyReceived(body1, collector);
+ assertMessageWithBodyReceived(body1, collector, conTwo.getUser());
conOne.instantShutdown();
@@ -65,10 +66,10 @@ public class StreamManagementTest extends AbstractSmackSpecificLowLevelIntegrati
// Reconnect with xep198
conOne.connect().login();
- assertMessageWithBodyReceived(body2, collector);
+ assertMessageWithBodyReceived(body2, collector, conTwo.getUser());
send(body3, conOne, conTwo);
- assertMessageWithBodyReceived(body3, collector);
+ assertMessageWithBodyReceived(body3, collector, conTwo.getUser());
}
finally {
collector.cancel();
@@ -84,9 +85,9 @@ public class StreamManagementTest extends AbstractSmackSpecificLowLevelIntegrati
from.sendStanza(message);
}
- private static void assertMessageWithBodyReceived(String body, StanzaCollector collector) throws InterruptedException {
+ private static void assertMessageWithBodyReceived(String body, StanzaCollector collector, EntityFullJid recipient) throws InterruptedException {
Message message = collector.nextResult();
- assertNotNull(message);
- assertEquals(body, message.getBody());
+ assertNotNull(message, "Expected '" + recipient + "' to receive a message stanza with body '" + body + "', but it didn't receive the message stanza at all.");
+ assertEquals(body, message.getBody(), "Expected '" + recipient + "'to receive a message stanza with a specific body, but it received a message stanza with a different body.");
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/WaitForClosingStreamElementTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/WaitForClosingStreamElementTest.java
index 2326866c7..dc9153aab 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smack/WaitForClosingStreamElementTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/WaitForClosingStreamElementTest.java
@@ -39,6 +39,6 @@ public class WaitForClosingStreamElementTest extends AbstractSmackLowLevelIntegr
Field closingStreamReceivedField = AbstractXMPPConnection.class.getDeclaredField("closingStreamReceived");
closingStreamReceivedField.setAccessible(true);
boolean closingStreamReceived = (boolean) closingStreamReceivedField.get(connection);
- assertTrue(closingStreamReceived);
+ assertTrue(closingStreamReceived, "Expected to, but did not, receive a closing stream element on connection " + connection);
}
}
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 55aad5c12..5f951c1d5 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
@@ -16,8 +16,6 @@
*/
package org.jivesoftware.smack.roster;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import java.util.Collection;
import java.util.concurrent.TimeoutException;
@@ -78,16 +76,16 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest {
BareJid bareJid = conTwo.getUser().asBareJid();
RosterEntry rosterEntry = rosterOne.getEntry(bareJid);
if (rosterEntry == null) {
- addedAndSubscribed.signalFailure("No roster entry for " + bareJid);
+ addedAndSubscribed.signalFailure("Added/Updated entry was not for " + bareJid);
return;
}
String name = rosterEntry.getName();
if (StringUtils.isNullOrEmpty(name)) {
- addedAndSubscribed.signalFailure("Roster entry without name");
+ addedAndSubscribed.signalFailure("Added/Updated entry without name");
return;
}
if (!rosterEntry.getName().equals(conTwosRosterName)) {
- addedAndSubscribed.signalFailure("Roster name does not match");
+ addedAndSubscribed.signalFailure("Added/Updated entry name does not match. Expected: " + conTwosRosterName + " but was: " + rosterEntry.getName());
return;
}
if (!rosterEntry.getType().equals(ItemType.to)) {
@@ -100,8 +98,9 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest {
try {
rosterOne.createItemAndRequestSubscription(conTwo.getUser().asBareJid(), conTwosRosterName, null);
-
- assertTrue(addedAndSubscribed.waitForResult(2 * connection.getReplyTimeout()));
+ assertResult(addedAndSubscribed, 2 * connection.getReplyTimeout(),
+ "A roster entry for " + conTwo.getUser().asBareJid() + " using the name '" + conTwosRosterName +
+ "' of type 'to' was expected to be added to the roster of " + conOne.getUser() + " (but it was not).");
}
finally {
rosterTwo.removeSubscribeListener(subscribeListener);
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java
index bcf23f627..c18ea490b 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/caps/EntityCapsTest.java
@@ -18,6 +18,7 @@ package org.jivesoftware.smackx.caps;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -96,7 +97,9 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
public void testLocalEntityCaps() throws InterruptedException, NoResponseException, XMPPErrorException, NotConnectedException {
final String dummyFeature = getNewDummyFeature();
DiscoverInfo info = EntityCapsManager.getDiscoveryInfoByNodeVer(ecmTwo.getLocalNodeVer());
- assertFalse(info.containsFeature(dummyFeature));
+ assertFalse(info.containsFeature(dummyFeature),
+ "Expected the service discovery info for node '" + ecmTwo.getLocalNodeVer() +
+ "' to contain the feature '" + dummyFeature + "' (but it did not)."); // TODO Shouldn't this assertion be in a unit test instead of an integration test?
dropWholeEntityCapsCache();
@@ -120,8 +123,12 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
// The other connection has to receive this stanza and record the
// information in order for this test to succeed.
info = EntityCapsManager.getDiscoveryInfoByNodeVer(ecmTwo.getLocalNodeVer());
- assertNotNull(info);
- assertTrue(info.containsFeature(dummyFeature));
+ assertNotNull(info,
+ "Expected '" + conOne.getUser() + "' to have received an 'available' presence from '" + conTwo.getUser() +
+ "' with a new CAPS 'ver' attribute (but it did not).");
+ assertTrue(info.containsFeature(dummyFeature),
+ "Expected the service discovery info for node '" + ecmTwo.getLocalNodeVer() +
+ "' to contain the feature '" + dummyFeature + "' (but it did not)."); // TODO As above: shouldn't this assertion be in a unit test instead of an integration test?
}
/**
@@ -148,7 +155,7 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
// discover that
DiscoverInfo info = sdmOne.discoverInfo(conTwo.getUser());
// that discovery should cause a disco#info
- assertTrue(discoInfoSend.get());
+ assertTrue(discoInfoSend.get(), "Expected '" + conOne.getUser() + "' to have made a disco/info request to '" + conTwo.getUser() + "', but it did not.");
assertTrue(info.containsFeature(dummyFeature),
"The info response '" + info + "' does not contain the expected feature '" + dummyFeature + '\'');
discoInfoSend.set(false);
@@ -156,8 +163,9 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
// discover that
info = sdmOne.discoverInfo(conTwo.getUser());
// that discovery shouldn't cause a disco#info
- assertFalse(discoInfoSend.get());
- assertTrue(info.containsFeature(dummyFeature));
+ assertFalse(discoInfoSend.get(), "Expected '" + conOne.getUser() + "' to not have made a disco/info request to '" + conTwo.getUser() + "' (as CAPS should have been cached), but it did not.");
+ assertTrue(info.containsFeature(dummyFeature),
+ "The info response '" + info + "' does not contain the expected feature '" + dummyFeature + '\'');
}
@SmackIntegrationTest
@@ -167,7 +175,8 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
addFeatureAndWaitForPresence(conOne, conTwo, dummyFeature);
String nodeVerAfter = EntityCapsManager.getNodeVersionByJid(conTwo.getUser());
- assertFalse(nodeVerBefore.equals(nodeVerAfter));
+ assertNotEquals(nodeVerBefore, nodeVerAfter,
+ "Expected the reported node 'ver' value to differ after a feature was added (but it did not).");
}
@SmackIntegrationTest
@@ -193,12 +202,12 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
DiscoverInfo info = sdmOne.discoverInfo(conTwo.getUser());
String u1ver = EntityCapsManager.getNodeVersionByJid(conTwo.getUser());
- assertNotNull(u1ver);
+ assertNotNull(u1ver, "Expected " + conOne.getUser() + " to have received a CAPS 'ver' value for " + conTwo.getUser() + " (but did not).");
DiscoverInfo entityInfo = EntityCapsManager.CAPS_CACHE.lookup(u1ver);
- assertNotNull(entityInfo);
+ assertNotNull(entityInfo, "Expected the local static cache to have a value cached for 'ver' value '" + u1ver + "' (but it did not).");
- assertEquals(info.toXML().toString(), entityInfo.toXML().toString());
+ assertEquals(info.toXML().toString(), entityInfo.toXML().toString(), "Expected the cached service/discovery info to be equal to the original (but it was not).");
}
private static void dropWholeEntityCapsCache() {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java
index fad509c4c..749b39caf 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/chatstate/ChatStateIntegrationTest.java
@@ -75,7 +75,7 @@ public class ChatStateIntegrationTest extends AbstractSmackIntegrationTest {
Chat chat = ChatManager.getInstanceFor(conOne)
.chatWith(conTwo.getUser().asEntityBareJid());
chat.send("Hi!");
- activeSyncPoint.waitForResult(timeout);
+ assertResult(activeSyncPoint, "Expected " + conTwo.getUser() + " to receive an 'active' chat state from " + conOne + " (but they did not).");
}
@AfterClass
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
index 6d37399d8..521692148 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
@@ -73,7 +73,9 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
AdHocCommandData response = result.getResponse();
DataForm form = response.getForm();
FormField field = form.getField("my-field");
- assertNotNull(field);
+ assertNotNull(field, "Expected a field named 'my-field' to exist in the form that " +
+ conTwo.getUser() + " obtained from " + conOne.getUser() + "'s command node '" + commandNode +
+ "' (but it did not).");
} finally {
manOne.unregisterCommand(commandNode);
}
@@ -259,7 +261,10 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
AdHocCommandResult.StatusCompleted completed = command.complete(submitForm).asCompletedOrThrow();
String operationResult = completed.getResponse().getForm().getField("result").getFirstValue();
- assertEquals("65", operationResult);
+ assertEquals("65", operationResult,
+ "Unexpected value in the field 'result' from the command result that " + conTwo.getUser() +
+ " received from " + conOne.getUser() + " after completing a multi-staged ad-hoc command on node '" +
+ commandNode + "'.");
} finally {
manTwo.unregisterCommand(commandNode);
}
@@ -317,7 +322,10 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
AdHocCommandResult.StatusCompleted completed = command.complete(submitForm).asCompletedOrThrow();
String operationResult = completed.getResponse().getForm().getField("result").getFirstValue();
- assertEquals("100", operationResult);
+ assertEquals("100", operationResult,
+ "Unexpected value in the field 'result' from the command result that " + conTwo.getUser() +
+ " received from " + conOne.getUser() + " after completing a multi-staged ad-hoc command on node '" +
+ commandNode + "'.");
} finally {
manTwo.unregisterCommand(commandNode);
}
@@ -346,7 +354,9 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
SubmitForm submitForm = form.getSubmitForm();
XMPPErrorException exception = assertThrows(XMPPErrorException.class, () -> command.next(submitForm));
- assertEquals(exception.getStanzaError().getCondition(), StanzaError.Condition.bad_request);
+ assertEquals(exception.getStanzaError().getCondition(), StanzaError.Condition.bad_request,
+ "Unexpected error condition received after " + conTwo.getUser() + " supplied an invalid argument " +
+ "to the command node '" + commandNode + "' of " + conOne.getUser());
} finally {
manTwo.unregisterCommand(commandNode);
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java
index 023959539..f2addc2ae 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java
@@ -32,7 +32,7 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
-import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
+import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
@SpecificationReference(document = "XEP-0096")
public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
@@ -67,7 +67,7 @@ public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
}
private void genericfileTransferTest() throws Exception {
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
final FileTransferListener receiveListener = new FileTransferListener() {
@Override
public void fileTransferRequest(FileTransferRequest request) {
@@ -84,7 +84,7 @@ public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
os.flush();
dataReceived = os.toByteArray();
if (Arrays.equals(dataToSend, dataReceived)) {
- resultSyncPoint.signal("Received data matches send data. \\o/");
+ resultSyncPoint.signal();
}
else {
resultSyncPoint.signal(new Exception("Received data does not match"));
@@ -117,7 +117,9 @@ public class FileTransferIntegrationTest extends AbstractSmackIntegrationTest {
}
}
- resultSyncPoint.waitForResult(MAX_FT_DURATION * 1000);
+ assertResult(resultSyncPoint, MAX_FT_DURATION * 1000,
+ "Expected data to be transferred successfully from " + conOne.getUser() + " to " + conTwo.getUser() +
+ " (but it did not).");
ftManagerTwo.removeFileTransferListener(receiveListener);
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java
index a67a3ee03..b58c04b71 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java
@@ -17,7 +17,6 @@
package org.jivesoftware.smackx.geolocation;
import java.net.URI;
-import java.util.concurrent.TimeoutException;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
@@ -37,7 +36,6 @@ import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
-import org.junit.jupiter.api.Assertions;
import org.jxmpp.util.XmppDateTime;
@SpecificationReference(document = "XEP-0080")
@@ -108,14 +106,9 @@ public class GeolocationIntegrationTest extends AbstractSmackIntegrationTest {
glm1.publishGeoLocation(data); // for the purpose of this test, this needs not be blocking/use publishAndWait();
// Wait for the data to be received.
- try {
- Object result = geoLocationReceived.waitForResult(timeout);
-
- // Explicitly assert the success case.
- Assertions.assertNotNull(result, "Expected to receive a PEP notification, but did not.");
- } catch (TimeoutException e) {
- Assertions.fail("Expected to receive a PEP notification, but did not.");
- }
+ assertResult(geoLocationReceived,
+ "Expected " + conTwo.getUser() + " to receive a PEP notification from " + conOne.getUser() +
+ " that contained '" + data.toXML() + "', but did not.");
} finally {
unregisterListener(glm2, geoLocationListener);
}
@@ -173,14 +166,9 @@ public class GeolocationIntegrationTest extends AbstractSmackIntegrationTest {
registerListenerAndWait(glm2, ServiceDiscoveryManager.getInstanceFor(conTwo), geoLocationListener);
// Wait for the data to be received.
- try {
- Object result = geoLocationReceived.waitForResult(timeout);
-
- // Explicitly assert the success case.
- Assertions.assertNotNull(result, "Expected to receive a PEP notification, but did not.");
- } catch (TimeoutException e) {
- Assertions.fail("Expected to receive a PEP notification, but did not.");
- }
+ assertResult(geoLocationReceived,
+ "Expected " + conTwo.getUser() + " to receive a PEP notification from " + conOne.getUser() +
+ " that contained '" + data.toXML() + "', but did not.");
} finally {
unregisterListener(glm2, geoLocationListener);
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java
index a823e03ad..8c92d8f1c 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadIntegrationTest.java
@@ -104,6 +104,6 @@ public class HttpFileUploadIntegrationTest extends AbstractSmackIntegrationTest
byte[] downBytes = baos.toByteArray();
- assertArrayEquals(upBytes, downBytes);
+ assertArrayEquals(upBytes, downBytes, "Expected the downloaded bytes to be equal to the uploaded bytes (but they were not).");
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java
index 1cbf4f2a9..903e17810 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java
@@ -89,7 +89,7 @@ public class IoTControlIntegrationTest extends AbstractSmackIntegrationTest {
SetData data = new SetBoolData(testRunId, true);
IoTSetResponse response = IoTControlManagerTwo.setUsingIq(conOne.getUser(), data);
- assertNotNull(response);
+ assertNotNull(response, "Expected " + conOne.getUser() + " to receive an IQ response with an 'setResponse' child element, but no such response was received.");
}
finally {
IoTControlManagerOne.uninstallThing(controlThing);
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java
index c95209cdb..fe4e39124 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDataIntegrationTest.java
@@ -86,23 +86,23 @@ public class IoTDataIntegrationTest extends AbstractSmackIntegrationTest {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
}
- assertEquals(1, values.size());
+ assertEquals(1, values.size(), "An unexpected amount of momentary values was received by " + conOne.getUser());
IoTFieldsExtension iotFieldsExtension = values.get(0);
List nodes = iotFieldsExtension.getNodes();
- assertEquals(1, nodes.size());
+ assertEquals(1, nodes.size(), "The momentary value received by " + conOne.getUser() + " contains an unexpected amount of nodes.");
NodeElement node = nodes.get(0);
List timestamps = node.getTimestampElements();
- assertEquals(1, timestamps.size());
+ assertEquals(1, timestamps.size(), "The node received by " + conOne.getUser() + " contains an unexpected amount of timestamps.");
TimestampElement timestamp = timestamps.get(0);
List extends IoTDataField> fields = timestamp.getDataFields();
- assertEquals(1, fields.size());
+ assertEquals(1, fields.size(), "The timestamp received by " + conOne.getUser() + " contains an unexpected amount of data fields.");
IoTDataField dataField = fields.get(0);
- assertTrue(dataField instanceof IoTDataField.IntField);
+ assertTrue(dataField instanceof IoTDataField.IntField, "The data field received by " + conOne.getUser() + " was expected to be an instance of " + IoTDataField.IntField.class.getSimpleName() + ", but instead, it was " + dataField.getClass().getSimpleName());
IoTDataField.IntField intDataField = (IoTDataField.IntField) dataField;
- assertEquals(testRunId, intDataField.getName());
- assertEquals(value, intDataField.getValue());
+ assertEquals(testRunId, intDataField.getName(), "Unexpected name in the data field received by " + conOne.getUser());
+ assertEquals(value, intDataField.getValue(), "Unexpected value in the data field received by " + conOne.getUser());
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java
index 3ef48c837..911259040 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java
@@ -62,7 +62,7 @@ public class IoTDiscoveryIntegrationTest extends AbstractSmackIntegrationTest {
registerThing(discoveryManagerOne, thing);
IoTClaimed iotClaimed = discoveryManagerTwo.claimThing(thing.getMetaTags());
- assertEquals(conOne.getUser().asBareJid(), iotClaimed.getJid());
+ assertEquals(conOne.getUser().asBareJid(), iotClaimed.getJid(), "Thing claimed by an unexpected JID");
discoveryManagerTwo.disownThing(iotClaimed.getJid());
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java
index c12ea5370..dd44d8c03 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iqversion/VersionIntegrationTest.java
@@ -47,8 +47,8 @@ public class VersionIntegrationTest extends AbstractSmackIntegrationTest {
final String versionName = "Smack Integration Test " + testRunId;
versionManagerTwo.setVersion(versionName, "1.0");
- assertTrue (versionManagerOne.isSupported(conTwo.getUser()));
+ assertTrue(versionManagerOne.isSupported(conTwo.getUser()), "Expected " + conTwo.getUser() + " to support " + Version.NAMESPACE + " (but it does not).");
Version version = versionManagerOne.getVersion(conTwo.getUser());
- assertEquals(versionName, version.getName());
+ assertEquals(versionName, version.getName(), "Unexpected version name reported by " + conTwo.getUser());
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java
index b9fcbea7e..cb1ebe12b 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java
@@ -115,14 +115,14 @@ public class MamIntegrationTest extends AbstractSmackIntegrationTest {
.build();
MamQuery mamQuery = mamManagerConTwo.queryArchive(mamQueryArgs);
- assertEquals(1, mamQuery.getMessages().size());
+ assertEquals(1, mamQuery.getMessages().size(), conTwo.getUser() + " received an unexpected amount of messages in response to a MAM query.");
Message mamMessage = mamQuery.getMessages().get(0);
- assertEquals(messageId, mamMessage.getStanzaId());
- assertEquals(messageBody, mamMessage.getBody());
- assertEquals(conOne.getUser(), mamMessage.getFrom());
- assertEquals(userTwo, mamMessage.getTo());
+ assertEquals(messageId, mamMessage.getStanzaId(), "The message received by " + conTwo.getUser() + " via a MAM query has an unexpected stanza ID.");
+ assertEquals(messageBody, mamMessage.getBody(), "The message received by " + conTwo.getUser() + " via a MAM query has an unexpected body.");
+ assertEquals(conOne.getUser(), mamMessage.getFrom(), "The message received by " + conTwo.getUser() + " via a MAM query has an unexpected from-attribute value.");
+ assertEquals(userTwo, mamMessage.getTo(), "The message received by " + conTwo.getUser() + " via a MAM query has an unexpected to-attribute value.");
}
@SmackIntegrationTest
@@ -176,8 +176,8 @@ public class MamIntegrationTest extends AbstractSmackIntegrationTest {
MamQuery mamQuery = mamManagerConTwo.queryArchive(mamQueryArgs);
- assertFalse(mamQuery.isComplete());
- assertEquals(messagesPerPage, mamQuery.getMessageCount());
+ assertFalse(mamQuery.isComplete(), "Expected the first MAM response received by " + conTwo.getUser() + " to NOT be complete (but it was).");
+ assertEquals(messagesPerPage, mamQuery.getMessageCount(), "Unexpected message count in MAM response received by " + conTwo.getUser());
List> pages = new ArrayList<>(numPages);
pages.add(mamQuery.getMessages());
@@ -187,12 +187,12 @@ public class MamIntegrationTest extends AbstractSmackIntegrationTest {
boolean isLastQuery = additionalPageRequestNum == numPages - 2;
if (isLastQuery) {
- assertTrue(mamQuery.isComplete());
+ assertTrue(mamQuery.isComplete(), "Expected the last MAM response received by " + conTwo.getUser() + " to be complete (but it was not).");
} else {
- assertFalse(mamQuery.isComplete());
+ assertFalse(mamQuery.isComplete(), "Expected an intermediate MAM response received by " + conTwo.getUser() + " to NOT be complete (but it was).");
}
- assertEquals(messagesPerPage, page.size());
+ assertEquals(messagesPerPage, page.size(), "Unexpected amount of messages in the MAM response page received by " + conTwo.getUser());
pages.add(page);
}
@@ -202,13 +202,13 @@ public class MamIntegrationTest extends AbstractSmackIntegrationTest {
queriedMessages.addAll(messages);
}
- assertEquals(outgoingMessages.size(), queriedMessages.size());
+ assertEquals(outgoingMessages.size(), queriedMessages.size(), "An unexpected total number of messages was received through MAM by " + conTwo.getUser());
for (int i = 0; i < outgoingMessages.size(); i++) {
Message outgoingMessage = outgoingMessages.get(i);
Message queriedMessage = queriedMessages.get(i);
- assertEquals(outgoingMessage.getBody(), queriedMessage.getBody());
+ assertEquals(outgoingMessage.getBody(), queriedMessage.getBody(), "Unexpected message body for message number " + (i + 1) + " as received by " + conTwo.getUser() + " (are messages received out of order?)");
}
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java
index bdfaa520e..ca30cbca2 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mood/MoodIntegrationTest.java
@@ -16,8 +16,6 @@
*/
package org.jivesoftware.smackx.mood;
-import java.util.concurrent.TimeoutException;
-
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;
@@ -33,7 +31,6 @@ import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
-import org.junit.jupiter.api.Assertions;
@SpecificationReference(document = "XEP-0107")
public class MoodIntegrationTest extends AbstractSmackIntegrationTest {
@@ -82,11 +79,7 @@ public class MoodIntegrationTest extends AbstractSmackIntegrationTest {
mm1.setMood(data); // for the purpose of this test, this needs not be blocking/use publishAndWait();
// Wait for the data to be received.
- try {
- moodReceived.waitForResult(timeout);
- } catch (TimeoutException e) {
- Assertions.fail("Expected to receive a PEP notification, but did not.");
- }
+ assertResult(moodReceived, "Expected " + conTwo.getUser() + " to receive a PEP notification, but did not.");
} finally {
unregisterListener(mm2, moodListener);
}
@@ -121,14 +114,7 @@ public class MoodIntegrationTest extends AbstractSmackIntegrationTest {
registerListenerAndWait(mm2, ServiceDiscoveryManager.getInstanceFor(conTwo), moodListener);
// Wait for the data to be received.
- try {
- Object result = moodReceived.waitForResult(timeout);
-
- // Explicitly assert the success case.
- Assertions.assertNotNull(result, "Expected to receive a PEP notification, but did not.");
- } catch (TimeoutException e) {
- Assertions.fail("Expected to receive a PEP notification, but did not.");
- }
+ assertResult(moodReceived, "Expected " + conTwo.getUser() + " to receive a PEP notification, but did not.");
} finally {
unregisterListener(mm2, moodListener);
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
index edf71b0a2..7af0f686f 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
@@ -35,6 +35,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.parts.Resourcepart;
@@ -58,9 +59,10 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
"sends a service discovery information (\"disco#info\") query to the MUC service's JID. The service MUST " +
"return its identity and the features it supports.")
public void mucTestForDiscoveringFeatures() throws Exception {
- DiscoverInfo info = mucManagerOne.getMucServiceDiscoInfo(mucManagerOne.getMucServiceDomains().get(0));
- assertTrue(info.getIdentities().size() > 0);
- assertTrue(info.getFeatures().size() > 0);
+ final DomainBareJid mucServiceAddress = mucManagerOne.getMucServiceDomains().get(0);
+ DiscoverInfo info = mucManagerOne.getMucServiceDiscoInfo(mucServiceAddress);
+ assertFalse(info.getIdentities().isEmpty(), "Expected the service discovery information for service " + mucServiceAddress + " to include identities (but it did not).");
+ assertFalse(info.getFeatures().isEmpty(), "Expected the service discovery information for service " + mucServiceAddress + " to include features (but it did not).");
}
/**
@@ -91,8 +93,8 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
tryDestroy(mucAsSeenByTwo);
}
- assertTrue(rooms.containsKey(mucAddressPublic));
- assertFalse(rooms.containsKey(mucAddressHidden));
+ assertTrue(rooms.containsKey(mucAddressPublic), "Expected the disco response from " + mucService + " to include the public room " + mucAddressPublic + " (but it did not).");
+ assertFalse(rooms.containsKey(mucAddressHidden), "Expected the disco response from " + mucService + " to not include the hidden room " + mucAddressHidden + " (but it did).");
}
/**
@@ -116,8 +118,8 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
tryDestroy(mucAsSeenByOne);
}
- assertTrue(discoInfo.getIdentities().size() > 0);
- assertTrue(discoInfo.getFeatures().size() > 0);
+ assertFalse(discoInfo.getIdentities().isEmpty(), "Expected the service discovery information for room " + mucAddress + " to include identities (but it did not).");
+ assertFalse(discoInfo.getFeatures().isEmpty(), "Expected the service discovery information for room " + mucAddress + " to include features (but it did not).");
}
/**
@@ -141,7 +143,7 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
tryDestroy(mucAsSeenByOne);
}
- assertEquals(1, roomItems.getItems().size());
+ assertEquals(1, roomItems.getItems().size(), "Unexpected amount of disco items for " + mucAddress);
}
/**
@@ -168,7 +170,8 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
XMPPException.XMPPErrorException xe;
try {
xe = assertThrows(XMPPException.XMPPErrorException.class,
- () -> ServiceDiscoveryManager.getInstanceFor(conTwo).discoverItems(mucAsSeenByOneUserJid));
+ () -> ServiceDiscoveryManager.getInstanceFor(conTwo).discoverItems(mucAsSeenByOneUserJid),
+ "Expected an XMPP error when " + conTwo.getUser() + " was trying to discover items of " + mucAsSeenByOneUserJid);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -182,6 +185,7 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
expectedCondition = StanzaError.Condition.not_acceptable;
break;
}
- assertEquals(xe.getStanzaError().getCondition(), expectedCondition);
+ assertEquals(xe.getStanzaError().getCondition(), expectedCondition,
+ "Unexpected error condition in error returned when " + conTwo.getUser() + " was trying to discover items of " + mucAsSeenByOneUserJid);
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
index c6e4e9209..930bbaf00 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
@@ -35,7 +35,6 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
-import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.parts.Resourcepart;
@@ -66,10 +65,10 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
MUCUser mucUser = MUCUser.from(reflectedJoinPresence);
- assertNotNull(mucUser);
- assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110));
- assertEquals(mucAddress + "/nick-one", reflectedJoinPresence.getFrom().toString());
- assertEquals(conOne.getUser().asEntityFullJidIfPossible().toString(), reflectedJoinPresence.getTo().toString());
+ assertNotNull(mucUser, "Expected, but unable, to create a MUCUser instance from reflected join presence: " + reflectedJoinPresence);
+ assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Expected the reflected join presence of " + conOne.getUser() + " of room " + mucAddress + " to include 'presence-to-self' (" + MUCUser.Status.PRESENCE_TO_SELF_110 + ") but it did not.");
+ assertEquals(mucAddress + "/nick-one", reflectedJoinPresence.getFrom().toString(), "Unexpected 'from' attribute value in the reflected join presence of " + conOne.getUser() + " of room " + mucAddress);
+ assertEquals(conOne.getUser().asEntityFullJidIfPossible().toString(), reflectedJoinPresence.getTo().toString(), "Unexpected 'to' attribute value in the reflected join presence of " + conOne.getUser() + " of room " + mucAddress);
} finally {
tryDestroy(muc);
}
@@ -94,11 +93,11 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
Presence reflectedLeavePresence = muc.leave();
MUCUser mucUser = MUCUser.from(reflectedLeavePresence);
- assertNotNull(mucUser);
+ assertNotNull(mucUser, "Expected, but unable, to create a MUCUser instance from reflected leave presence: " + reflectedLeavePresence);
- assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110));
- assertEquals(mucAddress + "/nick-one", reflectedLeavePresence.getFrom().toString());
- assertEquals(conOne.getUser().asEntityFullJidIfPossible().toString(), reflectedLeavePresence.getTo().toString());
+ assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Expected the reflected leave presence of " + conOne.getUser() + " of room " + mucAddress + " to include 'presence-to-self' (" + MUCUser.Status.PRESENCE_TO_SELF_110 + ") but it did not.");
+ assertEquals(mucAddress + "/nick-one", reflectedLeavePresence.getFrom().toString(), "Unexpected 'from' attribute value in the reflected leave presence of " + conOne.getUser() + " of room " + mucAddress);
+ assertEquals(conOne.getUser().asEntityFullJidIfPossible().toString(), reflectedLeavePresence.getTo().toString(), "Unexpected 'to' attribute value in the reflected leave presence of " + conOne.getUser() + " of room " + mucAddress);
} finally {
muc.join(Resourcepart.from("nick-one")); // We need to be in the room to destroy the room
tryDestroy(muc);
@@ -113,14 +112,14 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
final String mucMessage = "Smack Integration Test MUC Test Message " + randomString;
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByTwo.addMessageListener(new MessageListener() {
@Override
public void processMessage(Message message) {
String body = message.getBody();
if (mucMessage.equals(body)) {
- resultSyncPoint.signal(body);
+ resultSyncPoint.signal();
}
}
});
@@ -128,10 +127,9 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
createMuc(mucAsSeenByOne, "one-" + randomString);
mucAsSeenByTwo.join(Resourcepart.from("two-" + randomString));
mucAsSeenByOne.sendMessage(mucMessage);
+
try {
- resultSyncPoint.waitForResult(timeout);
- } catch (TimeoutException e) {
- throw new AssertionError("Failed to receive presence", e);
+ assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to receive message that was sent by " + conOne.getUser() + " in room " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -166,19 +164,20 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
muc.addUserStatusListener(userStatusListener);
- assertEquals(1, mucManagerOne.getJoinedRooms().size());
- assertEquals(1, muc.getOccupantsCount());
- assertNotNull(muc.getNickname());
+ // These would be a test implementation bug, not assertion failure.
+ if (mucManagerOne.getJoinedRooms().size() != 1) {
+ throw new IllegalStateException("Expected user to have joined a room.");
+ }
try {
muc.destroy("Dummy reason", null);
- mucDestroyed.waitForResult(timeout);
+ assertResult(mucDestroyed, "Expected " + conOne.getUser() + " to be notified of destruction of room " + mucAddress + " (but was not).");
} finally {
muc.removeUserStatusListener(userStatusListener);
}
- assertEquals(0, mucManagerOne.getJoinedRooms().size());
- assertEquals(0, muc.getOccupantsCount());
+ assertEquals(0, mucManagerOne.getJoinedRooms().size(), "Expected " + conOne.getUser() + " to no longer be in any rooms after " + mucAddress + " was destroyed (but was).");
+ assertEquals(0, muc.getOccupantsCount(), "Expected room " + mucAddress + " to no longer have any occupants after it was destroyed (but it has).");
assertNull(muc.getNickname());
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java
index 7cc418b2c..e77bc40cc 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java
@@ -85,7 +85,7 @@ public class MultiUserChatLowLevelIntegrationTest extends AbstractSmackLowLevelI
// So we trigger it manually here.
MucBookmarkAutojoinManager.getInstanceFor(connection).autojoinBookmarkedConferences();
- assertTrue(muc.isJoined());
+ assertTrue(muc.isJoined(), "Expected " + connection.getUser() + " to automatically join room " + muc.getRoom() + " after a reconnect, but it did not.");
// If the test went well, leave the MUC
muc.leave();
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 b4259bae1..d171ecabb 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
@@ -23,6 +23,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.util.concurrent.TimeoutException;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;
@@ -34,6 +37,7 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
+import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid;
@@ -65,12 +69,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByTwo.addUserStatusListener(new UserStatusListener() {
@Override
public void moderatorGranted() {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -83,7 +87,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
// success" in §9.6, since it'll throw on either an error IQ or on no response.
mucAsSeenByOne.grantModerator(nicknameTwo);
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to get a presence update after it was granted the role 'moderator' role in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -105,12 +109,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByThree = mucManagerThree.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByThree.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void moderatorGranted(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -122,7 +126,8 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByThree.join(nicknameThree);
mucAsSeenByOne.grantModerator(nicknameTwo);
- resultSyncPoint.waitForResult(timeout);
+
+ assertResult(resultSyncPoint, "Expected " + conThree.getUser() + " to get a presence update after another user in the room was granted the 'moderator' role in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -144,12 +149,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByTwo.addUserStatusListener(new UserStatusListener() {
@Override
public void moderatorRevoked() {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -160,7 +165,8 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantModerator(nicknameTwo);
mucAsSeenByOne.revokeModerator(nicknameTwo);
- resultSyncPoint.waitForResult(timeout);
+
+ assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to get a presence update after its 'moderator' role in " + mucAddress + " was revoked (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -182,12 +188,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByThree = mucManagerThree.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByThree.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void moderatorRevoked(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -200,7 +206,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantModerator(nicknameTwo);
mucAsSeenByOne.revokeModerator(nicknameTwo);
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conThree.getUser() + " to get a presence update after the 'moderator' role of another user in the room was revoked in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -221,12 +227,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByTwo.addUserStatusListener(new UserStatusListener() {
@Override
public void voiceRevoked() {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -235,7 +241,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
final Resourcepart nicknameTwo = Resourcepart.from("two-" + randomString);
mucAsSeenByTwo.join(nicknameTwo);
mucAsSeenByOne.revokeVoice(nicknameTwo);
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to get a presence update after its 'voice' privilege was revoked in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -257,12 +263,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByThree = mucManagerThree.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByThree.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void voiceRevoked(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -274,7 +280,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByThree.join(nicknameThree);
mucAsSeenByOne.revokeVoice(nicknameTwo);
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conThree.getUser() + " to get a presence update after another user's 'voice' privilege was revoked in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -295,13 +301,13 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByTwo.addUserStatusListener(new UserStatusListener() {
@Override
public void adminGranted() {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -312,7 +318,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
// This implicitly tests "The service MUST add the user to the admin list and then inform the owner of success" in §10.6, since it'll throw on either an error IQ or on no response.
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to get a presence update after its was granted 'admin' affiliation in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -335,12 +341,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByThree = mucManagerThree.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByThree.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void adminGranted(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -352,7 +358,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByThree.join(nicknameThree);
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conThree.getUser() + " to get a presence update after another user was granted 'admin' affiliation in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -374,12 +380,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByTwo.addUserStatusListener(new UserStatusListener() {
@Override
public void adminRevoked() {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -390,7 +396,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
mucAsSeenByOne.revokeAdmin(conTwo.getUser().asEntityBareJid());
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to get a presence update after its 'admin' affiliation was revoked in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -425,12 +431,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
MultiUserChat mucAsSeenByThree = mucManagerThree.getMultiUserChat(mucAddress);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByThree.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void adminRevoked(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -443,7 +449,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
mucAsSeenByOne.revokeAdmin(conTwo.getUser().asEntityBareJid());
- resultSyncPoint.waitForResult(timeout);
+ assertResult(resultSyncPoint, "Expected " + conThree.getUser() + " to get a presence update after another user's 'admin' affiliation was revoked in " + mucAddress + " (but it did not).");
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -477,16 +483,18 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.kickParticipant(nicknameTwo, "Nothing personal. Just a test.");
Presence kickPresence = resultSyncPoint.waitForResult(timeout);
MUCUser mucUser = MUCUser.from(kickPresence);
- assertNotNull(mucUser);
+ assertNotNull(mucUser, "Expected, but unable, to create a MUCUser instance from 'kick' presence: " + kickPresence);
assertAll(
- () -> assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Missing self-presence status code in kick presence"),
- () -> assertTrue(mucUser.getStatus().contains(MUCUser.Status.KICKED_307), "Missing kick status code in kick presence"),
- () -> assertEquals(MUCRole.none, mucUser.getItem().getRole(), "Role other than 'none' in kick presence")
+ () -> assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Missing self-presence status code in kick presence received by " + conTwo.getUser() + " after being kicked from room " + mucAddress),
+ () -> assertTrue(mucUser.getStatus().contains(MUCUser.Status.KICKED_307), "Missing kick status code in kick presence received by " + conTwo.getUser() + " after being kicked from room " + mucAddress),
+ () -> assertEquals(MUCRole.none, mucUser.getItem().getRole(), "Role other than 'none' in kick presence received by " + conTwo.getUser() + " after being kicked from room " + mucAddress)
);
Jid itemJid = mucUser.getItem().getJid();
if (itemJid != null) {
- assertEquals(conTwo.getUser().asEntityFullJidIfPossible(), itemJid, "Incorrect kicked user in kick presence");
+ assertEquals(conTwo.getUser().asEntityFullJidIfPossible(), itemJid, "Incorrect kicked user in kick presence received by " + conTwo.getUser() + " after being kicked from room " + mucAddress);
}
+ } catch (TimeoutException e) {
+ fail("Expected " + conTwo.getUser() + " to receive a presence update after it was kicked from room " + mucAddress + " (but it did not).", e);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -522,16 +530,18 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.kickParticipant(nicknameTwo, "Nothing personal. Just a test.");
Presence kickPresence = resultSyncPoint.waitForResult(timeout);
MUCUser mucUser = MUCUser.from(kickPresence);
- assertNotNull(mucUser);
+ assertNotNull(mucUser, "Expected, but unable, to create a MUCUser instance from 'kick' presence: " + kickPresence);
assertAll(
- () -> assertFalse(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Incorrect self-presence status code in kick presence"),
- () -> assertTrue(mucUser.getStatus().contains(MUCUser.Status.KICKED_307), "Missing kick status code in kick presence"),
- () -> assertEquals(MUCRole.none, mucUser.getItem().getRole(), "Role other than 'none' in kick presence")
+ () -> assertFalse(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Incorrect self-presence status code in kick presence received by " + conThree.getUser() + " after another user was kicked from room " + mucAddress),
+ () -> assertTrue(mucUser.getStatus().contains(MUCUser.Status.KICKED_307), "Missing kick status code in kick presence received by " + conThree.getUser() + " after another user was kicked from room " + mucAddress),
+ () -> assertEquals(MUCRole.none, mucUser.getItem().getRole(), "Role other than 'none' in kick presence received by " + conThree.getUser() + " after another user was kicked from room " + mucAddress)
);
Jid itemJid = mucUser.getItem().getJid();
if (itemJid != null) {
- assertEquals(conTwo.getUser().asEntityFullJidIfPossible(), itemJid, "Incorrect kicked user in kick presence");
+ assertEquals(conTwo.getUser().asEntityFullJidIfPossible(), itemJid, "Incorrect kicked user in kick presence received by " + conThree.getUser() + " after another user was kicked from room " + mucAddress);
}
+ } catch (TimeoutException e) {
+ fail("Expected " + conThree.getUser() + " to receive a presence update after another user was kicked from room " + mucAddress + " (but it did not).", e);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -570,8 +580,8 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByThree.leave();
Presence p2 = mucAsSeenByTwo.join(nicknameTwo);
Presence p3 = mucAsSeenByThree.join(nicknameThree);
- assertEquals(MUCAffiliation.owner, MUCUser.from(p2).getItem().getAffiliation());
- assertEquals(MUCAffiliation.admin, MUCUser.from(p3).getItem().getAffiliation());
+ assertEquals(MUCAffiliation.owner, MUCUser.from(p2).getItem().getAffiliation(), "Unexpected affiliation of " + conTwo.getUser() + " after it re-joined room " + mucAddress);
+ assertEquals(MUCAffiliation.admin, MUCUser.from(p3).getItem().getAffiliation(), "Unexpected affiliation of " + conThree.getUser() + " after it re-joined room " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -602,8 +612,9 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByTwo.join(nicknameTwo);
mucAsSeenByOne.grantModerator(nicknameTwo);
XMPPException.XMPPErrorException xe = assertThrows(XMPPException.XMPPErrorException.class,
- () -> mucAsSeenByTwo.revokeVoice(nicknameOne));
- assertEquals(xe.getStanzaError().getCondition().toString(), "not-allowed");
+ () -> mucAsSeenByTwo.revokeVoice(nicknameOne),
+ "Expected an XMPP error when " + conTwo.getUser() + " was trying to revoke the 'voice' privilege of " + conOne.getUser() + " in room " + mucAddress);
+ assertEquals(xe.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected stanza error condition in error returned when " + conTwo.getUser() + " was trying to revoke the 'voice' privilege of " + conOne.getUser() + " in room " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -640,16 +651,19 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
// Admin cannot revoke from Owner
XMPPException.XMPPErrorException xe1 = assertThrows(XMPPException.XMPPErrorException.class,
- () -> mucAsSeenByTwo.revokeModerator(nicknameOne));
- // Moderator cannot revoke from Admin
- XMPPException.XMPPErrorException xe2 = assertThrows(XMPPException.XMPPErrorException.class,
- () -> mucAsSeenByThree.revokeModerator(nicknameOne));
+ () -> mucAsSeenByTwo.revokeModerator(nicknameOne),
+ "Expected an XMPP error when " + conTwo.getUser() + " (an admin) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
// Moderator cannot revoke from Owner
+ XMPPException.XMPPErrorException xe2 = assertThrows(XMPPException.XMPPErrorException.class,
+ () -> mucAsSeenByThree.revokeModerator(nicknameOne),
+ "Expected an XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
+ // Moderator cannot revoke from Admin
XMPPException.XMPPErrorException xe3 = assertThrows(XMPPException.XMPPErrorException.class,
- () -> mucAsSeenByThree.revokeModerator(nicknameTwo));
- assertEquals(xe1.getStanzaError().getCondition().toString(), "not-allowed");
- assertEquals(xe2.getStanzaError().getCondition().toString(), "not-allowed");
- assertEquals(xe3.getStanzaError().getCondition().toString(), "not-allowed");
+ () -> mucAsSeenByThree.revokeModerator(nicknameTwo),
+ "Expected an XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conTwo.getUser() + " (an admin) in room " + mucAddress);
+ assertEquals(xe1.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected condition in XMPP error when " + conTwo.getUser() + " (an admin) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
+ assertEquals(xe2.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected condition in XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
+ assertEquals(xe3.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected condition in XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conTwo.getUser() + " (an admin) in room " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -678,23 +692,23 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByTwo.join(nicknameTwo);
mucAsSeenByThree.join(nicknameThree);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void adminGranted(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
resultSyncPoint.waitForResult(timeout);
- assertEquals(mucAsSeenByOne.getOccupantsCount(), 3);
- assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(
- JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole());
- assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(
- JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole());
- assertEquals(MUCRole.participant, mucAsSeenByOne.getOccupant(
- JidCreate.entityFullFrom(mucAddress, nicknameThree)).getRole());
+ assertEquals(mucAsSeenByOne.getOccupantsCount(), 3, "Unexpected occupant count in room " + mucAddress);
+ assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole(),
+ "Unexpected role for occupant " + nicknameOne + " of " + mucAddress);
+ assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole(),
+ "Unexpected role for occupant " + nicknameTwo + " of " + mucAddress);
+ assertEquals(MUCRole.participant, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameThree)).getRole(),
+ "Unexpected role for occupant " + nicknameThree + " of " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -718,11 +732,11 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
final Resourcepart nicknameTwo = Resourcepart.from("two-" + randomString);
final Resourcepart nicknameThree = Resourcepart.from("three-" + randomString);
- final ResultSyncPoint resultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void adminGranted(EntityFullJid participant) {
- resultSyncPoint.signal("done");
+ resultSyncPoint.signal();
}
});
@@ -744,13 +758,13 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
resultSyncPoint.waitForResult(timeout);
- assertEquals(mucAsSeenByOne.getOccupantsCount(), 3);
- assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(
- JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole());
- assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(
- JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole());
- assertEquals(threeRole, mucAsSeenByOne.getOccupant(
- JidCreate.entityFullFrom(mucAddress, nicknameThree)).getRole());
+ assertEquals(mucAsSeenByOne.getOccupantsCount(), 3, "Unexpected occupant count in room " + mucAddress);
+ assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole(),
+ "Unexpected role for occupant " + nicknameOne + " of " + mucAddress);
+ assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole(),
+ "Unexpected role for occupant " + nicknameTwo + " of " + mucAddress);
+ assertEquals(threeRole, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameThree)).getRole(),
+ "Unexpected role for occupant " + nicknameThree + " of " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -780,11 +794,11 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
createMembersOnlyMuc(mucAsSeenByOne, nicknameOne);
- final ResultSyncPoint adminResultSyncPoint = new ResultSyncPoint<>();
+ final SimpleResultSyncPoint adminResultSyncPoint = new SimpleResultSyncPoint();
mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
public void adminGranted(EntityFullJid participant) {
- adminResultSyncPoint.signal("done");
+ adminResultSyncPoint.signal();
}
});
@@ -796,10 +810,10 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByThree.join(nicknameThree);
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
adminResultSyncPoint.waitForResult(timeout);
- assertEquals(mucAsSeenByOne.getOccupantsCount(), 3);
- assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidOne).getRole());
- assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidTwo).getRole());
- assertEquals(MUCRole.participant, mucAsSeenByOne.getOccupant(jidThree).getRole());
+ assertEquals(mucAsSeenByOne.getOccupantsCount(), 3, "Unexpected occupant count in room " + mucAddress);
+ assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidOne).getRole(), "Unexpected role for occupant " + jidOne + " in room " + mucAddress);
+ assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidTwo).getRole(), "Unexpected role for occupant " + jidTwo + " in room " + mucAddress);
+ assertEquals(MUCRole.participant, mucAsSeenByOne.getOccupant(jidThree).getRole(), "Unexpected role for occupant " + jidThree + " in room " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/AbstractTwoUsersOmemoIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/AbstractTwoUsersOmemoIntegrationTest.java
index 1720c0725..995fc14a8 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/AbstractTwoUsersOmemoIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/AbstractTwoUsersOmemoIntegrationTest.java
@@ -17,7 +17,7 @@
package org.jivesoftware.smackx.omemo;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
import java.io.IOException;
@@ -51,7 +51,9 @@ public abstract class AbstractTwoUsersOmemoIntegrationTest extends AbstractOmemo
alice = OmemoManagerSetupHelper.prepareOmemoManager(conOne);
bob = OmemoManagerSetupHelper.prepareOmemoManager(conTwo);
- assertFalse(alice.getDeviceId().equals(bob.getDeviceId()));
+ // TODO is this a test assertion, or a bug in the test implementation (in which case an Exception should be thrown instead).
+ assertNotEquals(alice.getDeviceId(), bob.getDeviceId(),
+ "Expected device ID for " + conOne.getUser() + " to differ from that of " + conTwo.getUser() + " (but they did not)");
// Subscribe presences
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(alice.getConnection(), bob.getConnection(), timeout);
@@ -59,8 +61,10 @@ public abstract class AbstractTwoUsersOmemoIntegrationTest extends AbstractOmemo
OmemoManagerSetupHelper.trustAllIdentitiesWithTests(alice, bob); // Alice trusts Bob's devices
OmemoManagerSetupHelper.trustAllIdentitiesWithTests(bob, alice); // Bob trusts Alice' and Mallory's devices
- assertEquals(bob.getOwnFingerprint(), alice.getActiveFingerprints(bob.getOwnJid()).get(bob.getOwnDevice()));
- assertEquals(alice.getOwnFingerprint(), bob.getActiveFingerprints(alice.getOwnJid()).get(alice.getOwnDevice()));
+ assertEquals(bob.getOwnFingerprint(), alice.getActiveFingerprints(bob.getOwnJid()).get(bob.getOwnDevice()),
+ "Expected fingerprint of " + conTwo.getUser() + "'s device as known to " + conOne.getUser() + " to be equal to " + conTwo.getUser() + "'s own fingerprint (but it was not).");
+ assertEquals(alice.getOwnFingerprint(), bob.getActiveFingerprints(alice.getOwnJid()).get(alice.getOwnDevice()),
+ "Expected fingerprint of " + conOne.getUser() + "'s device as known to " + conTwo.getUser() + " to be equal to " + conOne.getUser() + "'s own fingerprint (but it was not).");
}
@AfterClass
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java
index 489dee26c..ff46adc8a 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoMamDecryptionTest.java
@@ -73,11 +73,12 @@ public class OmemoMamDecryptionTest extends AbstractTwoUsersOmemoIntegrationTest
alicesConnection.sendStanza(encrypted.buildMessage(messageBuilder, bob.getOwnJid()));
MamManager.MamQuery query = bobsMamManager.queryArchive(MamManager.MamQueryArgs.builder().limitResultsToJid(alice.getOwnJid()).build());
- assertEquals(1, query.getMessageCount());
+ assertEquals(1, query.getMessageCount(), "Unexpected message count in MAM query result of " + bob.getConnection().getUser());
List decryptedMamQuery = bob.decryptMamQueryResult(query);
- assertEquals(1, decryptedMamQuery.size());
- assertEquals(body, decryptedMamQuery.get(decryptedMamQuery.size() - 1).getOmemoMessage().getBody());
+ assertEquals(1, decryptedMamQuery.size(), "Unexpected decrypted message count in MAM query result of " + bob.getConnection().getUser());
+ assertEquals(body, decryptedMamQuery.get(decryptedMamQuery.size() - 1).getOmemoMessage().getBody(),
+ "Expected decrypted body of message retrieved via a MAM query to be equal to the original body that was sent (but it was not).");
}
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
index 4e2377c26..a9f664f43 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
@@ -125,9 +125,9 @@ public class PubSubIntegrationTest extends AbstractSmackIntegrationTest {
Item item = new PayloadItem<>(itemId, dummyPayload);
leafNode.publish(item);
- });
- assertEquals(StanzaError.Type.MODIFY, e.getStanzaError().getType());
- assertNotNull(e.getStanzaError().getExtension("item-forbidden", "http://jabber.org/protocol/pubsub#errors"));
+ }, "Expected an error after publishing item " + itemId + " (but none occurred).");
+ assertEquals(StanzaError.Type.MODIFY, e.getStanzaError().getType(), "Unexpected error type");
+ assertNotNull(e.getStanzaError().getExtension("item-forbidden", "http://jabber.org/protocol/pubsub#errors"), "Expected error to contain 'item-forbidden', but it did not.");
}
finally {
pubSubManagerOne.deleteNode(nodename);
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java
index 64374e173..35e5547d5 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java
@@ -64,7 +64,8 @@ public class SoftwareInfoIntegrationTest extends AbstractSmackIntegrationTest {
}
});
SoftwareInfoForm softwareInfoFormReceived = sim2.fromJid(conOne.getUser());
- assertEquals(softwareInfoSent, softwareInfoFormReceived);
+ assertEquals(softwareInfoSent, softwareInfoFormReceived,
+ "Expected " + conOne.getUser() + "'s software version info as received by " + conTwo.getUser() + " to be equal to what " + conOne.getUser() + " publishes (but it is not).");
}
private static SoftwareInfoForm createSoftwareInfoForm() throws URISyntaxException {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java
index db3275d00..6127b80d7 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java
@@ -17,7 +17,6 @@
package org.jivesoftware.smackx.usertune;
import java.net.URI;
-import java.util.concurrent.TimeoutException;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NotLoggedInException;
@@ -140,14 +139,7 @@ public class UserTuneIntegrationTest extends AbstractSmackIntegrationTest {
registerListenerAndWait(utm2, ServiceDiscoveryManager.getInstanceFor(conTwo), userTuneListener);
// Wait for the data to be received.
- try {
- Object result = userTuneReceived.waitForResult(timeout);
-
- // Explicitly assert the success case.
- Assertions.assertNotNull(result, "Expected to receive a PEP notification, but did not.");
- } catch (TimeoutException e) {
- Assertions.fail("Expected to receive a PEP notification, but did not.");
- }
+ assertResult(userTuneReceived, "Expected " + conTwo.getUser() + " to receive a PEP notification from " + conOne.getUser() + ", but did not.");
} finally {
unregisterListener(utm2, userTuneListener);
}
From c67292ea860e55b977cad0736008c3c1301f7ce2 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Wed, 10 Apr 2024 11:40:55 +0200
Subject: [PATCH 021/150] [sinttest]: Fix order of arguments in assertEquals()
When using 'assertEquals', the first argument is to be the _expected_ value, the second the _actual_ value. When this is inverted, the functional test will still succeed, but any generated error message ("Expected X, got Y") will be wrong.
This commit fixes the order of arguments, mostly in the sinttest module.
---
.../commands/AdHocCommandIntegrationTest.java | 2 +-
.../muc/MultiUserChatEntityIntegrationTest.java | 2 +-
...RolesAffiliationsPrivilegesIntegrationTest.java | 14 +++++++-------
.../org/jivesoftware/smackx/xdata/FormTest.java | 5 +++--
.../smackx/jingle/nat/STUNResolverTest.java | 4 ++--
.../smackx/jingle/nat/TransportCandidateTest.java | 2 +-
6 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
index 521692148..3e2b55516 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java
@@ -354,7 +354,7 @@ public class AdHocCommandIntegrationTest extends AbstractSmackIntegrationTest {
SubmitForm submitForm = form.getSubmitForm();
XMPPErrorException exception = assertThrows(XMPPErrorException.class, () -> command.next(submitForm));
- assertEquals(exception.getStanzaError().getCondition(), StanzaError.Condition.bad_request,
+ assertEquals(StanzaError.Condition.bad_request, exception.getStanzaError().getCondition(),
"Unexpected error condition received after " + conTwo.getUser() + " supplied an invalid argument " +
"to the command node '" + commandNode + "' of " + conOne.getUser());
} finally {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
index 7af0f686f..30b052466 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
@@ -185,7 +185,7 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
expectedCondition = StanzaError.Condition.not_acceptable;
break;
}
- assertEquals(xe.getStanzaError().getCondition(), expectedCondition,
+ assertEquals(expectedCondition, xe.getStanzaError().getCondition(),
"Unexpected error condition in error returned when " + conTwo.getUser() + " was trying to discover items of " + mucAsSeenByOneUserJid);
}
}
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 d171ecabb..f5fc7472f 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
@@ -614,7 +614,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
XMPPException.XMPPErrorException xe = assertThrows(XMPPException.XMPPErrorException.class,
() -> mucAsSeenByTwo.revokeVoice(nicknameOne),
"Expected an XMPP error when " + conTwo.getUser() + " was trying to revoke the 'voice' privilege of " + conOne.getUser() + " in room " + mucAddress);
- assertEquals(xe.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected stanza error condition in error returned when " + conTwo.getUser() + " was trying to revoke the 'voice' privilege of " + conOne.getUser() + " in room " + mucAddress);
+ assertEquals("not-allowed", xe.getStanzaError().getCondition().toString(), "Unexpected stanza error condition in error returned when " + conTwo.getUser() + " was trying to revoke the 'voice' privilege of " + conOne.getUser() + " in room " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -661,9 +661,9 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
XMPPException.XMPPErrorException xe3 = assertThrows(XMPPException.XMPPErrorException.class,
() -> mucAsSeenByThree.revokeModerator(nicknameTwo),
"Expected an XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conTwo.getUser() + " (an admin) in room " + mucAddress);
- assertEquals(xe1.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected condition in XMPP error when " + conTwo.getUser() + " (an admin) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
- assertEquals(xe2.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected condition in XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
- assertEquals(xe3.getStanzaError().getCondition().toString(), "not-allowed", "Unexpected condition in XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conTwo.getUser() + " (an admin) in room " + mucAddress);
+ assertEquals("not-allowed", xe1.getStanzaError().getCondition().toString(), "Unexpected condition in XMPP error when " + conTwo.getUser() + " (an admin) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
+ assertEquals("not-allowed", xe2.getStanzaError().getCondition().toString(), "Unexpected condition in XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conOne.getUser() + " (an owner) in room " + mucAddress);
+ assertEquals("not-allowed", xe3.getStanzaError().getCondition().toString(), "Unexpected condition in XMPP error when " + conThree.getUser() + " (a moderator) was trying to revoke the 'moderator' role of " + conTwo.getUser() + " (an admin) in room " + mucAddress);
} finally {
tryDestroy(mucAsSeenByOne);
}
@@ -702,7 +702,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
resultSyncPoint.waitForResult(timeout);
- assertEquals(mucAsSeenByOne.getOccupantsCount(), 3, "Unexpected occupant count in room " + mucAddress);
+ assertEquals(3, mucAsSeenByOne.getOccupantsCount(), "Unexpected occupant count in room " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole(),
"Unexpected role for occupant " + nicknameOne + " of " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole(),
@@ -758,7 +758,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
resultSyncPoint.waitForResult(timeout);
- assertEquals(mucAsSeenByOne.getOccupantsCount(), 3, "Unexpected occupant count in room " + mucAddress);
+ assertEquals(3, mucAsSeenByOne.getOccupantsCount(), "Unexpected occupant count in room " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole(),
"Unexpected role for occupant " + nicknameOne + " of " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole(),
@@ -810,7 +810,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
mucAsSeenByThree.join(nicknameThree);
mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
adminResultSyncPoint.waitForResult(timeout);
- assertEquals(mucAsSeenByOne.getOccupantsCount(), 3, "Unexpected occupant count in room " + mucAddress);
+ assertEquals(3, mucAsSeenByOne.getOccupantsCount(), "Unexpected occupant count in room " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidOne).getRole(), "Unexpected role for occupant " + jidOne + " in room " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidTwo).getRole(), "Unexpected role for occupant " + jidTwo + " in room " + mucAddress);
assertEquals(MUCRole.participant, mucAsSeenByOne.getOccupant(jidThree).getRole(), "Unexpected role for occupant " + jidThree + " in room " + mucAddress);
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
index 64b4db597..667beedb7 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
@@ -148,8 +148,9 @@ public class FormTest extends AbstractSmackIntegrationTest {
assertNotNull(completedForm2.getField("name"));
assertNotNull(completedForm2.getField("description"));
assertEquals(
- completedForm2.getField("name").getValues().get(0).toString(),
- "Credit card number invalid");
+ "Credit card number invalid",
+ completedForm2.getField("name").getValues().get(0).toString()
+ );
assertNotNull(completedForm2.getField("time"));
assertNotNull(completedForm2.getField("age"));
assertEquals("20", completedForm2.getField("age").getValues().get(0).toString(), "The age is bad");
diff --git a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/STUNResolverTest.java b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/STUNResolverTest.java
index 5d9425a92..febac9374 100644
--- a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/STUNResolverTest.java
+++ b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/STUNResolverTest.java
@@ -99,7 +99,7 @@ public class STUNResolverTest extends SmackTestCase {
stunResolver.addCandidate(cand3);
stunResolver.addCandidate(cand4);
- assertEquals(stunResolver.getPreferredCandidate(), candH);
+ assertEquals(candH, stunResolver.getPreferredCandidate());
}
/**
@@ -127,7 +127,7 @@ public class STUNResolverTest extends SmackTestCase {
iceResolver.addCandidate(cand3);
iceResolver.addCandidate(cand4);
- assertEquals(iceResolver.getPreferredCandidate(), candH);
+ assertEquals(candH, iceResolver.getPreferredCandidate());
}
/**
diff --git a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java
index 36830e911..763d52877 100644
--- a/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java
+++ b/smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java
@@ -65,7 +65,7 @@ public class TransportCandidateTest extends SmackTestCase {
candList.add(cand4);
Collections.sort(candList);
- assertEquals(candList.get(candList.size() - 1), candH);
+ assertEquals(candH, candList.get(candList.size() - 1));
}
protected int getMaxConnections() {
From 621dc4886561676f29c6fa44c2a52adcecbba2e4 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Wed, 10 Apr 2024 12:40:27 +0200
Subject: [PATCH 022/150] Smack 4.5.0-alpha3
---
version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version b/version
index 0c77728e0..9f61a282f 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-4.5.0-alpha3-SNAPSHOT
+4.5.0-alpha3
From 78814d2f864dae4e5a6c7969742071e0f1397628 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Wed, 10 Apr 2024 13:20:52 +0200
Subject: [PATCH 023/150] Smack 4.5.0-alpha4-SNAPSHOT
---
version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version b/version
index 9f61a282f..196915bff 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-4.5.0-alpha3
+4.5.0-alpha4-SNAPSHOT
From 900b25235c10d67975a9b26cf16e1dd6e19ea8f4 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Wed, 10 Apr 2024 16:06:45 +0200
Subject: [PATCH 024/150] [sinttest] Refactoring XEP-0045 test for default
roles
When testing for default role assignment based on affiliation, depending on the 'adminGranted' callback is dangerous, as this callback appears to be only invoked when the affected occupant has already joined the room.
The exact occupant count isn't something that these tests need to assert either.
This commit changes the test implementations to proceed when all expected occupants have been detected by the user performing the change.
These changes combined intend to make the tests more robust, with regards to the order in which several events are fired (which might be unexpeced, given threading implementation in server (clusters) and Smack stanza handling.
---
...AffiliationsPrivilegesIntegrationTest.java | 74 ++++++++++++-------
1 file changed, 47 insertions(+), 27 deletions(-)
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 f5fc7472f..53b44765c 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
@@ -25,7 +25,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
+import java.util.Set;
import java.util.concurrent.TimeoutException;
+import java.util.stream.Collectors;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;
@@ -687,22 +689,30 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
final Resourcepart nicknameTwo = Resourcepart.from("two-" + randomString);
final Resourcepart nicknameThree = Resourcepart.from("three-" + randomString);
+ final EntityFullJid jidOne = JidCreate.entityFullFrom(mucAddress, nicknameOne);
+ final EntityFullJid jidTwo = JidCreate.entityFullFrom(mucAddress, nicknameTwo);
+ final EntityFullJid jidThree = JidCreate.entityFullFrom(mucAddress, nicknameThree);
+
createMuc(mucAsSeenByOne, nicknameOne);
+
+ final SimpleResultSyncPoint allOccupantsDetectedSyncPoint = new SimpleResultSyncPoint();
+ final Set expectedOccupants = Set.of(jidOne, jidTwo, jidThree);
+ mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
+ @Override
+ public void joined(EntityFullJid participant) {
+ if (mucAsSeenByOne.getOccupants().containsAll(expectedOccupants)) {
+ allOccupantsDetectedSyncPoint.signal();
+ }
+ }
+ });
+
try {
+ mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
+
mucAsSeenByTwo.join(nicknameTwo);
mucAsSeenByThree.join(nicknameThree);
- final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
- mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
- @Override
- public void adminGranted(EntityFullJid participant) {
- resultSyncPoint.signal();
- }
- });
- mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
- resultSyncPoint.waitForResult(timeout);
-
- assertEquals(3, mucAsSeenByOne.getOccupantsCount(), "Unexpected occupant count in room " + mucAddress);
+ assertResult(allOccupantsDetectedSyncPoint, "Expected " + conOne.getUser() + " to observe all of these occupants in room " + mucAddress + ", but not all of them appear to be in: " + expectedOccupants.stream().map(Object::toString).collect(Collectors.joining(", ")));
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole(),
"Unexpected role for occupant " + nicknameOne + " of " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole(),
@@ -732,16 +742,23 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
final Resourcepart nicknameTwo = Resourcepart.from("two-" + randomString);
final Resourcepart nicknameThree = Resourcepart.from("three-" + randomString);
- final SimpleResultSyncPoint resultSyncPoint = new SimpleResultSyncPoint();
- mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
- @Override
- public void adminGranted(EntityFullJid participant) {
- resultSyncPoint.signal();
- }
- });
+ final EntityFullJid jidOne = JidCreate.entityFullFrom(mucAddress, nicknameOne);
+ final EntityFullJid jidTwo = JidCreate.entityFullFrom(mucAddress, nicknameTwo);
+ final EntityFullJid jidThree = JidCreate.entityFullFrom(mucAddress, nicknameThree);
createModeratedMuc(mucAsSeenByOne, nicknameOne);
+ final SimpleResultSyncPoint allOccupantsDetectedSyncPoint = new SimpleResultSyncPoint();
+ final Set expectedOccupants = Set.of(jidOne, jidTwo, jidThree);
+ mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
+ @Override
+ public void joined(EntityFullJid participant) {
+ if (mucAsSeenByOne.getOccupants().containsAll(expectedOccupants)) {
+ allOccupantsDetectedSyncPoint.signal();
+ }
+ }
+ });
+
final MUCRole threeRole;
switch (sinttestConfiguration.compatibilityMode) {
default:
@@ -753,12 +770,12 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
try {
+ mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
+
mucAsSeenByTwo.join(nicknameTwo);
mucAsSeenByThree.join(nicknameThree);
- mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
- resultSyncPoint.waitForResult(timeout);
- assertEquals(3, mucAsSeenByOne.getOccupantsCount(), "Unexpected occupant count in room " + mucAddress);
+ assertResult(allOccupantsDetectedSyncPoint, "Expected " + conOne.getUser() + " to observe all of these occupants in room " + mucAddress + ", but not all of them appear to be in: " + expectedOccupants.stream().map(Object::toString).collect(Collectors.joining(", ")));
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameOne)).getRole(),
"Unexpected role for occupant " + nicknameOne + " of " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(JidCreate.entityFullFrom(mucAddress, nicknameTwo)).getRole(),
@@ -794,23 +811,26 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
createMembersOnlyMuc(mucAsSeenByOne, nicknameOne);
- final SimpleResultSyncPoint adminResultSyncPoint = new SimpleResultSyncPoint();
+ final SimpleResultSyncPoint allOccupantsDetectedSyncPoint = new SimpleResultSyncPoint();
+ final Set expectedOccupants = Set.of(jidOne, jidTwo, jidThree);
mucAsSeenByOne.addParticipantStatusListener(new ParticipantStatusListener() {
@Override
- public void adminGranted(EntityFullJid participant) {
- adminResultSyncPoint.signal();
+ public void joined(EntityFullJid participant) {
+ if (mucAsSeenByOne.getOccupants().containsAll(expectedOccupants)) {
+ allOccupantsDetectedSyncPoint.signal();
+ }
}
});
try {
mucAsSeenByOne.grantMembership(conTwo.getUser().asBareJid());
mucAsSeenByOne.grantMembership(conThree.getUser().asBareJid());
+ mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
mucAsSeenByTwo.join(nicknameTwo);
mucAsSeenByThree.join(nicknameThree);
- mucAsSeenByOne.grantAdmin(conTwo.getUser().asBareJid());
- adminResultSyncPoint.waitForResult(timeout);
- assertEquals(3, mucAsSeenByOne.getOccupantsCount(), "Unexpected occupant count in room " + mucAddress);
+
+ assertResult(allOccupantsDetectedSyncPoint, "Expected " + conOne.getUser() + " to observe all of these occupants in room " + mucAddress + ", but not all of them appear to be in: " + expectedOccupants.stream().map(Object::toString).collect(Collectors.joining(", ")));
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidOne).getRole(), "Unexpected role for occupant " + jidOne + " in room " + mucAddress);
assertEquals(MUCRole.moderator, mucAsSeenByOne.getOccupant(jidTwo).getRole(), "Unexpected role for occupant " + jidTwo + " in room " + mucAddress);
assertEquals(MUCRole.participant, mucAsSeenByOne.getOccupant(jidThree).getRole(), "Unexpected role for occupant " + jidThree + " in room " + mucAddress);
From d515a24e1cc63c51022c384f6b22a9ac600d0c46 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 11 Apr 2024 15:07:10 +0200
Subject: [PATCH 025/150] [sinttest] Fix processing of SpecificationReference
When refactoring the original implementation, this annotation was expected to be present on methods. It later was changed to be a type-based annotation. This particular usage of the annotation was not properly modified to account for that change.
---
.../smack/inttest/SmackIntegrationTestFramework.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index ae8198ba7..a1008748a 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -138,7 +138,7 @@ public class SmackIntegrationTestFramework {
for (FailedTest failedTest : testRunResult.failedIntegrationTests) {
final Throwable cause = failedTest.failureReason;
LOGGER.log(Level.SEVERE, failedTest.concreteTest + " failed: " + cause, cause);
- if (failedTest.concreteTest.method.isAnnotationPresent(SpecificationReference.class)) {
+ if (failedTest.concreteTest.method.getDeclaringClass().isAnnotationPresent(SpecificationReference.class)) {
final String specificationReference = getSpecificationReference(failedTest.concreteTest.method);
if (specificationReference != null) {
bySpecification.add("- " + specificationReference + " (as tested by '" + failedTest.concreteTest + "')");
From 5622bb07d1fd0403ec326b9feafc41af04e1adb8 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 11 Apr 2024 16:09:07 +0200
Subject: [PATCH 026/150] [sinttest] Allow custom processing of test run result
This adds a new configuration option, `testRunResultProcessors`, that allows a user to customize the way the results of a test run is processed.
By default, the pre-exising printing-to-stderr is used.
---
.../smack/inttest/Configuration.java | 32 +++++++
.../SmackIntegrationTestFramework.java | 92 +++++++++++--------
.../smack/inttest/package-info.java | 17 ++++
3 files changed, 103 insertions(+), 38 deletions(-)
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 19c7d4d93..a60b3e21e 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
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.lang.reflect.Method;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -31,6 +32,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Logger;
+import java.util.stream.Collectors;
import javax.net.ssl.SSLContext;
@@ -131,6 +133,8 @@ public final class Configuration {
public final CompatibilityMode compatibilityMode;
+ public final List extends SmackIntegrationTestFramework.TestRunResultProcessor> testRunResultProcessors;
+
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'.");
@@ -203,6 +207,7 @@ public final class Configuration {
this.dnsResolver = builder.dnsResolver;
this.compatibilityMode = builder.compatibilityMode;
+ this.testRunResultProcessors = builder.testRunResultProcessors;
}
public boolean isAccountRegistrationPossible() {
@@ -263,6 +268,8 @@ public final class Configuration {
private CompatibilityMode compatibilityMode = CompatibilityMode.standardsCompliant;
+ private List extends SmackIntegrationTestFramework.TestRunResultProcessor> testRunResultProcessors;
+
private Builder() {
}
@@ -473,6 +480,15 @@ public final class Configuration {
return setCompatibilityMode(compatibilityMode);
}
+ public Builder setTestRunResultProcessors(String testRunResultProcessorsString) {
+ if (testRunResultProcessorsString == null) {
+ return this;
+ }
+
+ testRunResultProcessors = getTestRunProcessorListFrom(testRunResultProcessorsString);
+ return this;
+ }
+
public Configuration build() throws KeyManagementException, NoSuchAlgorithmException {
return new Configuration(this);
}
@@ -550,6 +566,9 @@ public final class Configuration {
builder.setCompatibilityMode(properties.getProperty("compatibilityMode"));
+ builder.setTestRunResultProcessors(properties.getProperty("testRunResultProcessors",
+ SmackIntegrationTestFramework.JulTestRunResultProcessor.class.getName()));
+
return builder.build();
}
@@ -605,6 +624,19 @@ public final class Configuration {
return split(input, Configuration::normalizeSpecification);
}
+ private static List extends SmackIntegrationTestFramework.TestRunResultProcessor> getTestRunProcessorListFrom(String input) {
+ return Arrays.stream(input.split(","))
+ .map(element -> {
+ try {
+ final Class extends SmackIntegrationTestFramework.TestRunResultProcessor> aClass = Class.forName(element).asSubclass(SmackIntegrationTestFramework.TestRunResultProcessor.class);
+ return aClass.getConstructor().newInstance();
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Unable to construct TestRunResultProcessor from value: " + element, e);
+ }
+ })
+ .collect(Collectors.toList());
+ }
+
private static Map> convertTestsToMap(Set tests) {
Map> res = new HashMap<>();
for (String test : tests) {
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index a1008748a..9cfb8a6b1 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -114,54 +114,65 @@ public class SmackIntegrationTestFramework {
SmackIntegrationTestFramework sinttest = new SmackIntegrationTestFramework(config);
TestRunResult testRunResult = sinttest.run();
- for (Map.Entry, Throwable> entry : testRunResult.impossibleTestClasses.entrySet()) {
- LOGGER.info("Could not run " + entry.getKey().getName() + " because: "
- + entry.getValue().getLocalizedMessage());
- }
- for (TestNotPossible testNotPossible : testRunResult.impossibleIntegrationTests) {
- LOGGER.info("Could not run " + testNotPossible.concreteTest + " because: "
- + testNotPossible.testNotPossibleException.getMessage());
- }
- for (SuccessfulTest successfulTest : testRunResult.successfulIntegrationTests) {
- LOGGER.info(successfulTest.concreteTest + " ✔");
- }
- final int successfulTests = testRunResult.successfulIntegrationTests.size();
- final int failedTests = testRunResult.failedIntegrationTests.size();
- final int availableTests = testRunResult.getNumberOfAvailableTests();
- LOGGER.info("SmackIntegrationTestFramework[" + testRunResult.testRunId + ']' + " finished: "
- + successfulTests + '/' + availableTests + " [" + failedTests + " failed]");
-
- final int exitStatus;
- if (failedTests > 0) {
- LOGGER.warning("💀 The following " + failedTests + " tests failed! 💀");
- final SortedSet bySpecification = new TreeSet<>();
- for (FailedTest failedTest : testRunResult.failedIntegrationTests) {
- final Throwable cause = failedTest.failureReason;
- LOGGER.log(Level.SEVERE, failedTest.concreteTest + " failed: " + cause, cause);
- if (failedTest.concreteTest.method.getDeclaringClass().isAnnotationPresent(SpecificationReference.class)) {
- final String specificationReference = getSpecificationReference(failedTest.concreteTest.method);
- if (specificationReference != null) {
- bySpecification.add("- " + specificationReference + " (as tested by '" + failedTest.concreteTest + "')");
- }
- }
+ for (final TestRunResultProcessor testRunResultProcessor : config.testRunResultProcessors) {
+ try {
+ testRunResultProcessor.process(testRunResult);
+ } catch (Throwable t) {
+ LOGGER.log(Level.WARNING, "Invocation of TestRunResultProcessor " + testRunResultProcessor + " failed.", t);
}
- if (!bySpecification.isEmpty()) {
- LOGGER.log(Level.SEVERE, "The failed tests correspond to the following specifications:" + System.lineSeparator() + String.join(System.lineSeparator(), bySpecification));
- }
-
- exitStatus = 2;
- } else {
- LOGGER.info("All possible Smack Integration Tests completed successfully. \\o/");
- exitStatus = 0;
}
if (config.debuggerFactory instanceof EnhancedDebugger) {
EnhancedDebuggerWindow.getInstance().waitUntilClosed();
}
+ final int exitStatus = testRunResult.failedIntegrationTests.isEmpty() ? 0 : 2;
System.exit(exitStatus);
}
+ public static class JulTestRunResultProcessor implements TestRunResultProcessor {
+
+ @Override
+ public void process(final TestRunResult testRunResult) {
+ for (Map.Entry, Throwable> entry : testRunResult.impossibleTestClasses.entrySet()) {
+ LOGGER.info("Could not run " + entry.getKey().getName() + " because: "
+ + entry.getValue().getLocalizedMessage());
+ }
+ for (TestNotPossible testNotPossible : testRunResult.impossibleIntegrationTests) {
+ LOGGER.info("Could not run " + testNotPossible.concreteTest + " because: "
+ + testNotPossible.testNotPossibleException.getMessage());
+ }
+ for (SuccessfulTest successfulTest : testRunResult.successfulIntegrationTests) {
+ LOGGER.info(successfulTest.concreteTest + " ✔");
+ }
+ final int successfulTests = testRunResult.successfulIntegrationTests.size();
+ final int failedTests = testRunResult.failedIntegrationTests.size();
+ final int availableTests = testRunResult.getNumberOfAvailableTests();
+ LOGGER.info("SmackIntegrationTestFramework[" + testRunResult.testRunId + ']' + " finished: "
+ + successfulTests + '/' + availableTests + " [" + failedTests + " failed]");
+
+ if (failedTests > 0) {
+ LOGGER.warning("💀 The following " + failedTests + " tests failed! 💀");
+ final SortedSet bySpecification = new TreeSet<>();
+ for (FailedTest failedTest : testRunResult.failedIntegrationTests) {
+ final Throwable cause = failedTest.failureReason;
+ LOGGER.log(Level.SEVERE, failedTest.concreteTest + " failed: " + cause, cause);
+ if (failedTest.concreteTest.method.getDeclaringClass().isAnnotationPresent(SpecificationReference.class)) {
+ final String specificationReference = getSpecificationReference(failedTest.concreteTest.method);
+ if (specificationReference != null) {
+ bySpecification.add("- " + specificationReference + " (as tested by '" + failedTest.concreteTest + "')");
+ }
+ }
+ }
+ if (!bySpecification.isEmpty()) {
+ LOGGER.log(Level.SEVERE, "The failed tests correspond to the following specifications:" + System.lineSeparator() + String.join(System.lineSeparator(), bySpecification));
+ }
+ } else {
+ LOGGER.info("All possible Smack Integration Tests completed successfully. \\o/");
+ }
+ }
+ }
+
private static String getSpecificationReference(Method method) {
final SpecificationReference spec = method.getDeclaringClass().getAnnotation(SpecificationReference.class);
if (spec == null || spec.document().isBlank()) {
@@ -665,6 +676,11 @@ public class SmackIntegrationTestFramework {
return (Exception) e;
}
+ @FunctionalInterface
+ public interface TestRunResultProcessor {
+ void process(SmackIntegrationTestFramework.TestRunResult testRunResult);
+ }
+
public static final class TestRunResult {
/**
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
index 38898eced..c72d0afc2 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
@@ -167,6 +167,10 @@
*
dnsResolver
*
One of ‘minidns’, ‘javax’ or ‘dnsjava’. Defaults to ‘minidns’.
*
+ *
+ *
testRunResultProcessors
+ *
List of class names for generating test run output. Defaults to 'org.igniterealtime.smack.inttest.SmackIntegrationTestFramework$ConsoleTestRunResultProcessor'
+ * By default, the results of the test run is printed to standard-error. You can, however, provide your own processing
+ * for the test run results. To do so, create an implementation of
+ * {@link org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.TestRunResultProcessor} and provide its class
+ * name to the testRunResultProcessor property. This property takes a comma separated list of class names.
+ *
*/
package org.igniterealtime.smack.inttest;
From 77dc527a637279f224753957d63033e245f537fe Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Wed, 17 Apr 2024 10:05:17 +0200
Subject: [PATCH 027/150] [sinttest] Carry over assertion message when sync
point times out
`AbstractSmackIntTest#assertResult()` takes an argument that is an assertion message. When the sync point times out, that message should be logged.
The following illustrates the change, as a result of this assertion failing:
```
assertResult(resultSyncPoint, "Expected " + conTwo.getUser() + " to receive message that was sent by " + conOne.getUser() + " in room " + mucAddress + " (but it did not).");
```
Prior to this change, this is logged:
```
SEVERE: MultiUserChatIntegrationTest.mucTest (Normal) failed: java.util.concurrent.TimeoutException: Timeout expired
java.util.concurrent.TimeoutException: Timeout expired
at org.igniterealtime.smack.inttest.util.ResultSyncPoint.waitForResult(ResultSyncPoint.java:49)
at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:104)
at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:99)
at org.jivesoftware.smackx.muc.MultiUserChatIntegrationTest.mucTest(MultiUserChatIntegrationTest.java:132)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
(snip)
```
With the change in this commit, that becomes:
```
SEVERE: MultiUserChatIntegrationTest.mucTest (Normal) failed: java.util.concurrent.TimeoutException: Expected smack-inttest-two-jskr4@example.org/two-jskr4 to receive message that was sent by smack-inttest-one-jskr4@example.org/one-jskr4 in room smack-inttest-message-jskr4-aud43i@conference.example.org (but it did not).
java.util.concurrent.TimeoutException: Expected smack-inttest-two-jskr4@example.org/two-jskr4 to receive message that was sent by smack-inttest-one-jskr4@example.org/one-jskr4 in room smack-inttest-message-jskr4-aud43i@conference.example.org (but it did not).
at org.igniterealtime.smack.inttest.util.ResultSyncPoint.waitForResult(ResultSyncPoint.java:53)
at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:104)
at org.igniterealtime.smack.inttest.AbstractSmackIntTest.assertResult(AbstractSmackIntTest.java:99)
at org.jivesoftware.smackx.muc.MultiUserChatIntegrationTest.mucTest(MultiUserChatIntegrationTest.java:132)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
(snip)
```
---
.../igniterealtime/smack/inttest/AbstractSmackIntTest.java | 2 +-
.../igniterealtime/smack/inttest/util/ResultSyncPoint.java | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
index c372103dc..11334dee8 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntTest.java
@@ -101,7 +101,7 @@ public abstract class AbstractSmackIntTest {
public static R assertResult(ResultSyncPoint syncPoint, long timeout, String message) throws InterruptedException, TimeoutException, AssertionFailedError {
try {
- return syncPoint.waitForResult(timeout);
+ return syncPoint.waitForResult(timeout, message);
} catch (InterruptedException | TimeoutException e) {
throw e;
} catch (Exception e) {
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java
index 37b143934..f7f10b63f 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/ResultSyncPoint.java
@@ -26,6 +26,10 @@ public class ResultSyncPoint {
private E exception;
public R waitForResult(long timeout) throws E, InterruptedException, TimeoutException {
+ return waitForResult(timeout, null);
+ }
+
+ public R waitForResult(long timeout, String timeoutMessage) throws E, InterruptedException, TimeoutException {
synchronized (this) {
if (result != null) {
return result;
@@ -46,7 +50,7 @@ public class ResultSyncPoint {
if (exception != null) {
throw exception;
}
- throw new TimeoutException("Timeout expired");
+ throw new TimeoutException(timeoutMessage == null ? "Timeout expired" : timeoutMessage);
}
From 26ec0d412d335d2c127f2928bc4f57a266cdc4c5 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Wed, 23 Feb 2022 14:29:25 +0100
Subject: [PATCH 028/150] SINT: Add roster tests that are driven by presence
stanzas
RFC-6121 defines server-sided behavior of the interaction between presence stanzas and rosters.
This commit adds tests for that behavior.
---
.../smack/roster/RosterIntegrationTest.java | 442 +++++++++++++++++-
1 file changed, 438 insertions(+), 4 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 5f951c1d5..23cb49deb 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
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2015-2020 Florian Schmaus
+ * Copyright 2015-2020 Florian Schmaus, 2022-2024 Guus der Kinderen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,21 +16,40 @@
*/
package org.jivesoftware.smack.roster;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.util.Collection;
import java.util.concurrent.TimeoutException;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.jivesoftware.smack.StanzaListener;
+import org.jivesoftware.smack.filter.AndFilter;
+import org.jivesoftware.smack.filter.FromMatchesFilter;
+import org.jivesoftware.smack.filter.PresenceTypeFilter;
+import org.jivesoftware.smack.filter.StanzaTypeFilter;
+import org.jivesoftware.smack.iqrequest.AbstractIqRequestHandler;
+import org.jivesoftware.smack.iqrequest.IQRequestHandler;
+import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Presence;
+import org.jivesoftware.smack.packet.PresenceBuilder;
+import org.jivesoftware.smack.roster.packet.RosterPacket;
import org.jivesoftware.smack.roster.packet.RosterPacket.ItemType;
+import org.jivesoftware.smack.sm.predicates.ForEveryStanza;
+import org.jivesoftware.smack.util.Consumer;
import org.jivesoftware.smack.util.StringUtils;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
+import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.Jid;
+@SpecificationReference(document = "RFC6121")
public class RosterIntegrationTest extends AbstractSmackIntegrationTest {
private final Roster rosterOne;
@@ -59,7 +78,7 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest {
final String conTwosRosterName = "ConTwo " + testRunId;
final SimpleResultSyncPoint addedAndSubscribed = new SimpleResultSyncPoint();
- rosterOne.addRosterListener(new AbstractRosterListener() {
+ final RosterListener rosterListener = new AbstractRosterListener() {
@Override
public void entriesAdded(Collection addresses) {
checkIfAddedAndSubscribed(addresses);
@@ -94,17 +113,432 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest {
addedAndSubscribed.signal();
}
}
- });
+ };
+
+ rosterOne.addRosterListener(rosterListener);
try {
rosterOne.createItemAndRequestSubscription(conTwo.getUser().asBareJid(), conTwosRosterName, null);
- assertResult(addedAndSubscribed, 2 * connection.getReplyTimeout(),
+ assertResult(addedAndSubscribed,
"A roster entry for " + conTwo.getUser().asBareJid() + " using the name '" + conTwosRosterName +
"' of type 'to' was expected to be added to the roster of " + conOne.getUser() + " (but it was not).");
}
finally {
rosterTwo.removeSubscribeListener(subscribeListener);
+ rosterOne.removeRosterListener(rosterListener);
}
}
+ /**
+ * Asserts that when a user sends out a presence subscription request, the server sends a roster push back to the
+ * user.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.2", quote =
+ "After locally delivering or remotely routing the presence subscription request, the user's server MUST then " +
+ "send a roster push to all of the user's interested resources, containing the potential contact with a " +
+ "subscription state of \"none\" and with notation that the subscription is pending (via an 'ask' attribute " +
+ "whose value is \"subscribe\").")
+ public void testRosterPushAfterSubscriptionRequest() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+ Roster.getInstanceFor(conTwo).setSubscriptionMode(Roster.SubscriptionMode.manual); // prevents a race condition when asserting the captured roster entry.
+ final ResultSyncPoint added = new ResultSyncPoint<>();
+
+ final RosterListener rosterListener = new AbstractRosterListener() {
+ @Override
+ public void entriesAdded(Collection addresses) {
+ for (Jid jid : addresses) {
+ if (!jid.equals(conTwo.getUser().asBareJid())) {
+ continue;
+ }
+ final BareJid bareJid = conTwo.getUser().asBareJid();
+ RosterEntry rosterEntry = rosterOne.getEntry(bareJid);
+ added.signal(rosterEntry);
+ return;
+ }
+ }
+ };
+ rosterOne.addRosterListener(rosterListener);
+
+ final Presence subscribe = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribe);
+
+ final RosterEntry rosterEntry = assertResult(added, "Expected the server to send a roster push back to '" + conOne.getUser() + "' after they sent a presence subscription request to '" + conTwo.getUser().asBareJid() + "' (but the server did not).");
+ assertEquals(ItemType.none, rosterEntry.getType(), "Unexpected subscription type on roster push after '" + conOne.getUser() + "' sent a presence subscription request to '" + conTwo.getUser().asBareJid() + "'.");
+ assertTrue(rosterEntry.isSubscriptionPending(), "Missing 'ask=subscribe' attribute on roster push after '" + conOne.getUser() + "' sent a presence subscription request to '" + conTwo.getUser().asBareJid() + "'.");
+ } finally {
+ rosterTwo.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ rosterOne.removeRosterListener(rosterListener);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.3", quote =
+ "if there is at least one available resource associated with the contact when the subscription request is " +
+ "received by the contact's server, then the contact's server MUST send that subscription request to all " +
+ "available resources in accordance with Section 8.")
+ public void testPresenceDeliveredToRecipient() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+
+ final ResultSyncPoint added = new ResultSyncPoint<>();
+ final StanzaListener stanzaListener = stanza -> added.signal((Presence) stanza);
+ conTwo.addAsyncStanzaListener(stanzaListener, new AndFilter(StanzaTypeFilter.PRESENCE, FromMatchesFilter.createBare(conOne.getUser())));
+
+ final Presence subscribe = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribe);
+ final Presence received = assertResult(added, "Expected subscription request from '" + conOne.getUser() + "' to '" + conTwo.getUser().asBareJid() + "' to be delivered to " + conTwo.getUser() + " (but it did not).");
+ assertEquals(Presence.Type.subscribe, received.getType(), "Unexpected presence type in presence stanza received by '" + conTwo.getUser() + "' after '" + conOne.getUser() + "' sent a presence subscription request.");
+ } finally {
+ conTwo.removeAsyncStanzaListener(stanzaListener);
+ }
+ }
+
+ /**
+ * Asserts that when a user sends a presence subscription approval, the server stamps the bare JID of the sender,
+ * and delivers it to the requester.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.5", quote =
+ "When the contact's client sends the subscription approval, the contact's server MUST stamp the outbound " +
+ "stanza with the bare JID of the contact and locally deliver or remotely route the " +
+ "stanza to the user.")
+ public void testPresenceApprovalStampedAndDelivered() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+
+ rosterTwo.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
+
+ // Modify the outbound 'subscribed' stanza, to be 'wrong' (addressed to a full rather than a bare JID), to test if the server overrides this.
+ final Consumer interceptor = (PresenceBuilder presenceBuilder) -> presenceBuilder.to(conOne.getUser()).build();
+ conTwo.addPresenceInterceptor(interceptor, p -> p.getType() == Presence.Type.subscribed);
+
+ final ResultSyncPoint added = new ResultSyncPoint<>();
+ final StanzaListener stanzaListener = stanza -> added.signal((Presence) stanza);
+
+ conOne.addAsyncStanzaListener(stanzaListener, PresenceTypeFilter.SUBSCRIBED);
+
+ final Presence subscribe = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribe);
+
+ final Presence received = assertResult(added, "Expected presence 'subscribed' stanza to be delivered to '" + conOne.getUser() + "' after '" + conTwo.getUser() + "' approved their subscription request (but it was not).");
+ assertEquals(conTwo.getUser().asBareJid(), received.getFrom().asEntityBareJidOrThrow(), "Expected presence 'subscribed' stanza that was delivered to '" + conOne.getUser() + "' after '" + conTwo.getUser() + "' approved their subscription request to have a 'from' attribute value that is associated to '" + conTwo.getUser().getLocalpart() + "' (but it did not).");
+ assertTrue(received.getFrom().isEntityBareJid(), "Expected presence 'subscribed' stanza that was delivered to '" + conOne.getUser() + "' after '" + conTwo.getUser() + "' approved their subscription request to have a 'from' attribute value that is a bare JID (but it was not).");
+ } finally {
+ rosterTwo.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ conTwo.removePresenceInterceptor(interceptor);
+ conOne.removeAsyncStanzaListener(stanzaListener);
+ }
+ }
+
+ /**
+ * Asserts that when a user sends a presence subscription approval, the server sends a roster push to the user with
+ * a subscription 'from'.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.5", quote =
+ "The contact's server then MUST send an updated roster push to all of the contact's interested resources, " +
+ "with the 'subscription' attribute set to a value of \"from\".")
+ public void testPresenceApprovalYieldsRosterPush() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+
+ rosterTwo.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
+
+ final ResultSyncPoint updated = new ResultSyncPoint<>();
+
+ final RosterListener rosterListener = new AbstractRosterListener() {
+ @Override
+ public void entriesAdded(Collection addresses) {
+ for (Jid jid : addresses) {
+ if (!jid.equals(conOne.getUser().asBareJid())) {
+ continue;
+ }
+ BareJid bareJid = conOne.getUser().asBareJid();
+ RosterEntry rosterEntry = rosterTwo.getEntry(bareJid);
+ updated.signal(rosterEntry);
+ }
+ }
+ };
+ rosterTwo.addRosterListener(rosterListener);
+
+ final Presence subscribe = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribe);
+ // The 'subscribe' gets automatically approved by conTwo.
+
+ final RosterEntry entry = assertResult(updated, "Expected '" + conTwo.getUser() + "' to receive a roster push with an update for the entry of '" + conOne.getUser().asBareJid() + "' after '" + conTwo.getUser() + "' approved their subscription request.");
+ assertEquals(ItemType.from, entry.getType(), "Unexpected type for '" + conOne.getUser().asBareJid() + "''s entry in '" + conTwo.getUser().asBareJid() + "''s roster.");
+ } finally {
+ rosterTwo.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ rosterTwo.removeRosterListener(rosterListener);
+ }
+ }
+
+ /**
+ * Asserts that when a user sends a presence subscription approval, the server sends a roster push to the user with
+ * a subscription 'both' when the contact already has a subscription to the other entity.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.5", quote =
+ "The contact's server then MUST send an updated roster push to all of the contact's interested resources, " +
+ "with the 'subscription' attribute set to a value of \"from\". (Here we assume that the contact does not " +
+ "already have a subscription to the user; if that were the case, the 'subscription' attribute would be set " +
+ "to a value of \"both\", as explained under Appendix A.)")
+ public void testPresenceApprovalYieldsRosterPush2() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+
+ // Setup fixture: establish one-way subscription.
+ rosterOne.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
+
+ final SimpleResultSyncPoint fixtureComplete = new SimpleResultSyncPoint();
+ RosterListener rosterListenerTwo = new AbstractRosterListener() {
+ @Override
+ public void entriesAdded(Collection addresses) {
+ checkIfAdded(addresses);
+ }
+ @Override
+ public void entriesUpdated(Collection addresses) {
+ checkIfAdded(addresses);
+ }
+ private void checkIfAdded(Collection addresses) {
+ for (Jid jid : addresses) {
+ final BareJid bareJid = conOne.getUser().asBareJid();
+ if (!jid.equals(bareJid)) {
+ continue;
+ }
+ if (rosterTwo.getEntry(bareJid) == null) {
+ continue;
+ }
+ if (rosterTwo.getEntry(bareJid).getType() == ItemType.none) {
+ continue;
+ }
+ fixtureComplete.signal();
+ rosterTwo.removeRosterListener(this);
+ }
+ }
+ };
+ rosterTwo.addRosterListener(rosterListenerTwo);
+
+ final Presence subscribeOne = conTwo.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conOne.getUser().asBareJid())
+ .build();
+ try {
+ conTwo.sendStanza(subscribeOne);
+
+ fixtureComplete.waitForResult(connection.getReplyTimeout());
+ } finally {
+ rosterOne.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ rosterTwo.removeRosterListener(rosterListenerTwo);
+ }
+
+ // Setup fixture is now complete. Execute the test.
+ rosterTwo.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
+
+ final ResultSyncPoint updated = new ResultSyncPoint<>();
+
+ rosterListenerTwo = new AbstractRosterListener() {
+ @Override
+ public void entriesUpdated(Collection addresses) {
+ for (Jid jid : addresses) {
+ if (!jid.equals(conOne.getUser().asBareJid())) {
+ continue;
+ }
+ BareJid bareJid = conOne.getUser().asBareJid();
+ updated.signal(rosterTwo.getEntry(bareJid));
+ }
+ }
+ };
+ rosterTwo.addRosterListener(rosterListenerTwo);
+
+ final Presence subscribeTwo = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribeTwo);
+
+ final RosterEntry entry = assertResult(updated, "Expected '" + conTwo.getUser() + "' to receive a roster push with an update for the entry of '" + conOne.getUser().asBareJid() + "' after '" + conOne.getUser() + "' approved their subscription request.");
+ assertEquals(ItemType.both, entry.getType(), "Unexpected type for '" + conOne.getUser().asBareJid() + "''s entry in '" + conTwo.getUser().asBareJid() + "''s roster.");
+ } finally {
+ rosterTwo.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ rosterTwo.removeRosterListener(rosterListenerTwo);
+ }
+ }
+
+ /**
+ * Asserts that when a presence subscription request is approved, the server sends the latest presence of the now
+ * subscribed entity to the subscriber.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.5", quote =
+ "The contact's server MUST then also send current presence to the user from each of the contact's available resources.")
+ public void testCurrentPresenceSentAfterSubscriptionApproval() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+
+ final String needle = "Look for me!";
+ conTwo.sendStanza(conTwo.getStanzaFactory().buildPresenceStanza().setStatus(needle).build());
+
+ rosterTwo.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
+
+ final SimpleResultSyncPoint received = new SimpleResultSyncPoint();
+ final StanzaListener stanzaListener = stanza -> {
+ final Presence presence = (Presence) stanza;
+ if (presence.getStatus().equals(needle)) {
+ received.signal();
+ }
+ };
+ conOne.addAsyncStanzaListener(stanzaListener, new AndFilter(StanzaTypeFilter.PRESENCE, FromMatchesFilter.createBare(conTwo.getUser())));
+
+ final Presence subscribe = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribe);
+
+ assertResult(received, "Expected '" + conTwo.getUser() + "' to receive '" + conOne.getUser() + "''s current presence update (including the status '" + needle + "'), but it did not.");
+ } finally {
+ rosterTwo.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ conOne.removeAsyncStanzaListener(stanzaListener);
+ }
+ }
+
+ /**
+ * Asserts that when a user receives a presence subscription approval, the server first sends the presence stanza,
+ * followed by a roster push.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "3.1.6", quote =
+ "(...) If this check is successful, then the user's server MUST: 1. Deliver the inbound subscription " +
+ "approval to all of the user's interested resources (...). This MUST occur before sending the roster push " +
+ "described in the next step. 2. Initiate a roster push to all of the user's interested resources, containing " +
+ "an updated roster item for the contact with the 'subscription' attribute set to a value of \"to\" (...) or " +
+ "\"both\" (...).")
+ public void testReceivePresenceApprovalAndRosterPush() throws Exception {
+ IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
+
+ rosterTwo.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
+
+ final ResultSyncPoint receivedRosterPush = new ResultSyncPoint<>();
+ final AtomicBoolean hasReceivedSubscriptionApproval = new AtomicBoolean(false);
+
+ // Replace the IQ Request Handler that processes roster pushes with one that's guaranteed to be executed
+ // synchronously with the stanza handler that listens for presence updates (below). This is to guarantee that
+ // the order in which both stanzas arrive is maintained during processing.
+ final IQRequestHandler synchronousReplacement = new AbstractIqRequestHandler(RosterPacket.ELEMENT, RosterPacket.NAMESPACE, IQ.Type.set, IQRequestHandler.Mode.sync) {
+ @Override
+ public IQ handleIQRequest(IQ iqRequest) {
+ receivedRosterPush.signal(hasReceivedSubscriptionApproval.get());
+ return IQ.createResultIQ(iqRequest);
+ }
+ };
+ final IQRequestHandler originalRequestHandler = conOne.registerIQRequestHandler(synchronousReplacement);
+
+ final StanzaListener presenceUpdateListener = stanza -> {
+ if (stanza instanceof Presence) {
+ final Presence presence = (Presence) stanza;
+ if (presence.getType() == Presence.Type.subscribed) {
+ hasReceivedSubscriptionApproval.set(true);
+ }
+ }
+ };
+
+ // Add as a synchronous listener, again to guarantee to maintain the order of the stanzas captured by this
+ // listener and the roster pushes captured by the IQ Request Handler (above).
+ conOne.addSyncStanzaListener(presenceUpdateListener, ForEveryStanza.INSTANCE);
+
+ final Presence subscribe = conOne.getStanzaFactory().buildPresenceStanza()
+ .ofType(Presence.Type.subscribe)
+ .to(conTwo.getUser().asBareJid())
+ .build();
+
+ try {
+ conOne.sendStanza(subscribe);
+ final boolean hasReceivedApproval = assertResult(receivedRosterPush, "Expected '" + conOne.getUser() + "' to receive a roster push containing an updated roster entry for '" + conTwo.getUser().asBareJid() + "'");
+ assertTrue(hasReceivedApproval, "Expected '" + conOne.getUser() + "' to have received a presence subscription approval from '" + conTwo.getUser().asBareJid() + "', before it received the roster push that contained the updated contact, but the presence subscription approval was not (yet) received when the roster push was.");
+ } finally {
+ rosterOne.setSubscriptionMode(Roster.getDefaultSubscriptionMode());
+ conOne.removeSyncStanzaListener(presenceUpdateListener);
+ conOne.registerIQRequestHandler(originalRequestHandler);
+ }
+ }
}
From ad756810c1b2e49990534d30af9b3cb8e11de60b Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Thu, 3 Mar 2022 17:06:25 +0100
Subject: [PATCH 029/150] 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.
From 8efa4bd7323d7b77d56e9eaed9d25e96afe701e6 Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Fri, 26 Apr 2024 17:16:03 +0200
Subject: [PATCH 030/150] [sinttest] Expand list of default test packages
The default set of packages that is scanned for integration tests are referencing jivesoftware. This commit adds igniterealtime-oriented package names.
---
.../smack/inttest/SmackIntegrationTestFramework.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index a1008748a..eec07893b 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -223,7 +223,7 @@ public class SmackIntegrationTestFramework {
String[] testPackages;
if (config.testPackages == null || config.testPackages.isEmpty()) {
- testPackages = new String[] { "org.jivesoftware.smackx", "org.jivesoftware.smack" };
+ testPackages = new String[] { "org.jivesoftware.smackx", "org.jivesoftware.smack", "org.igniterealtime.smackx", "org.igniterealtime.smack" };
}
else {
testPackages = config.testPackages.toArray(new String[config.testPackages.size()]);
From 855f01e6b2d8e35ee6ac440f204e9d91e80c645c Mon Sep 17 00:00:00 2001
From: Dan Caseley
Date: Thu, 17 Jun 2021 18:40:45 +0100
Subject: [PATCH 031/150] [sinttest] Additional tests for s7 of XEP-0045
---
.../smackx/muc/MucConfigFormManager.java | 13 +-
.../inttest/util/MultiResultSyncPoint.java | 59 +
.../AbstractMultiUserChatIntegrationTest.java | 73 ++
.../MultiUserChatEntityIntegrationTest.java | 30 +-
.../muc/MultiUserChatIntegrationTest.java | 67 +-
.../MultiUserChatOccupantIntegrationTest.java | 1102 +++++++++++++++++
.../util/MultiResultSyncPointTest.java | 108 ++
.../inttest/util/ResultSyncPointTest.java | 13 +
8 files changed, 1393 insertions(+), 72 deletions(-)
create mode 100644 smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPoint.java
create mode 100644 smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java
create mode 100644 smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPointTest.java
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java
index 1735d0b4f..80371f7c8 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java
@@ -223,6 +223,15 @@ public class MucConfigFormManager {
}
+ /**
+ * Check if the room supports its visibility being controlled vioa configuration.
+ *
+ * @return true if supported, false if not.
+ */
+ public boolean supportsPublicRoom() {
+ return answerForm.hasField(MUC_ROOMCONFIG_PUBLICLYSEARCHABLEROOM);
+ }
+
/**
* Make the room publicly searchable.
*
@@ -251,7 +260,7 @@ public class MucConfigFormManager {
* @throws MucConfigurationNotSupportedException if the requested MUC configuration is not supported by the MUC service.
*/
public MucConfigFormManager setPublic(boolean isPublic) throws MucConfigurationNotSupportedException {
- if (!supportsModeration()) {
+ if (!supportsPublicRoom()) {
throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_PUBLICLYSEARCHABLEROOM);
}
answerForm.setAnswer(MUC_ROOMCONFIG_PUBLICLYSEARCHABLEROOM, isPublic);
@@ -299,7 +308,7 @@ public class MucConfigFormManager {
*/
public MucConfigFormManager setIsPasswordProtected(boolean isPasswordProtected)
throws MucConfigurationNotSupportedException {
- if (!supportsMembersOnly()) {
+ if (!supportsPasswordProtected()) {
throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_PASSWORDPROTECTEDROOM);
}
answerForm.setAnswer(MUC_ROOMCONFIG_PASSWORDPROTECTEDROOM, isPasswordProtected);
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPoint.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPoint.java
new file mode 100644
index 000000000..22e046d64
--- /dev/null
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPoint.java
@@ -0,0 +1,59 @@
+/**
+ *
+ * Copyright 2021 Guus der Kinderen
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.igniterealtime.smack.inttest.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeoutException;
+
+import org.jivesoftware.smack.util.Objects;
+
+public class MultiResultSyncPoint {
+
+ private final List results;
+ private E exception;
+ private final int expectedResultCount;
+
+ public MultiResultSyncPoint(int expectedResultCount) {
+ this.expectedResultCount = expectedResultCount;
+ this.results = new ArrayList<>(expectedResultCount);
+ }
+
+ public synchronized List waitForResults(long timeout) throws E, InterruptedException, TimeoutException {
+ long now = System.currentTimeMillis();
+ final long deadline = now + timeout;
+ while (results.size() < expectedResultCount && exception == null && now < deadline) {
+ wait(deadline - now);
+ now = System.currentTimeMillis();
+ }
+ if (now >= deadline) throw new TimeoutException("Timeout waiting " + timeout + " millis");
+ if (exception != null) throw exception;
+ return new ArrayList<>(results);
+ }
+
+ public synchronized void signal(R result) {
+ this.results.add(Objects.requireNonNull(result));
+ if (expectedResultCount <= results.size()) {
+ notifyAll();
+ }
+ }
+
+ public synchronized void signal(E exception) {
+ this.exception = Objects.requireNonNull(exception);
+ notifyAll();
+ }
+}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java
index 22316ed6e..2ad9ca2d4 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java
@@ -22,6 +22,8 @@ import java.util.List;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.util.StringUtils;
+import org.jivesoftware.smackx.xdata.form.FillableForm;
+import org.jivesoftware.smackx.xdata.form.Form;
import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
@@ -140,4 +142,75 @@ public abstract class AbstractMultiUserChatIntegrationTest extends AbstractSmack
.makeHidden()
.submitConfigurationForm();
}
+
+ /**
+ * Creates a non-anonymous room.
+ *
+ *
From XEP-0045 § 10.1.3:
+ *
+ * Note: The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"),
+ * semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here).
+ *
+ * Note: The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"),
+ * semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here).
+ *
+ */
+ static void createSemiAnonymousMuc(MultiUserChat muc, Resourcepart resourceName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException, MultiUserChatException.MucAlreadyJoinedException, SmackException.NotConnectedException, MultiUserChatException.MissingMucCreationAcknowledgeException, MultiUserChatException.NotAMucServiceException {
+ muc.create(resourceName);
+ Form configForm = muc.getConfigurationForm();
+ FillableForm answerForm = configForm.getFillableForm();
+ answerForm.setAnswer("muc#roomconfig_whois", "moderators");
+ muc.sendConfigurationForm(answerForm);
+ }
+
+ /**
+ * Creates a password-protected room.
+ */
+ static void createPasswordProtectedMuc(MultiUserChat muc, Resourcepart resourceName, String password) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException, MultiUserChatException.MucAlreadyJoinedException, SmackException.NotConnectedException, MultiUserChatException.MissingMucCreationAcknowledgeException, MultiUserChatException.NotAMucServiceException {
+ muc.create(resourceName);
+ Form configForm = muc.getConfigurationForm();
+ FillableForm answerForm = configForm.getFillableForm();
+ answerForm.setAnswer("muc#roomconfig_passwordprotectedroom", true);
+ answerForm.setAnswer("muc#roomconfig_roomsecret", password);
+ muc.sendConfigurationForm(answerForm);
+ }
+
+ static void createLockedMuc(MultiUserChat muc, Resourcepart resourceName) throws
+ SmackException.NoResponseException, XMPPException.XMPPErrorException,
+ InterruptedException, MultiUserChatException.MucAlreadyJoinedException,
+ SmackException.NotConnectedException,
+ MultiUserChatException.MissingMucCreationAcknowledgeException,
+ MultiUserChatException.NotAMucServiceException {
+ muc.create(resourceName);
+ // Note the absence of handle.makeInstant() here. The room is still being created at this point, until a
+ // configuration is set.
+ }
+
+ static void setMaxUsers(MultiUserChat muc, int maxUsers) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException, SmackException.NotConnectedException {
+ Form configForm = muc.getConfigurationForm();
+ FillableForm answerForm = configForm.getFillableForm();
+ answerForm.setAnswer("muc#roomconfig_maxusers", maxUsers);
+ muc.sendConfigurationForm(answerForm);
+ }
+
+ static void setPublicLogging(MultiUserChat muc, boolean publicLogging) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException, SmackException.NotConnectedException {
+ Form configForm = muc.getConfigurationForm();
+ FillableForm answerForm = configForm.getFillableForm();
+ answerForm.setAnswer("muc#roomconfig_enablelogging", publicLogging);
+ muc.sendConfigurationForm(answerForm);
+ }
}
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
index 30b052466..0a8dcf175 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java
@@ -22,6 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.SmackException;
@@ -30,11 +31,13 @@ import org.jivesoftware.smack.packet.StanzaError;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
+import org.jivesoftware.smackx.muc.packet.MUCInitialPresence;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid;
@@ -49,6 +52,21 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
super(environment);
}
+ /**
+ * Asserts that a MUC service can be discovered.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "6.1", quote =
+ "An entity often discovers a MUC service by sending a Service Discovery items (\"disco#items\") request to " +
+ "its own server. The server then returns the services that are associated with it.")
+ public void mucTestForDiscoveringMuc() throws Exception {
+ // This repeats some logic from the `AbstractMultiUserChatIntegrationTest` constructor, but is preserved here
+ // as an explicit test, because that might not always be true.
+ List services = ServiceDiscoveryManager.getInstanceFor(conOne).findServices(MUCInitialPresence.NAMESPACE, true, false);
+ assertFalse(services.isEmpty(), "Expected to be able to find MUC services on the domain that '" + conOne.getUser() + "' is connecting to (but could not).");
+ }
+
/**
* Asserts that a MUC service can have its features discovered.
*
@@ -56,13 +74,12 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
*/
@SmackIntegrationTest(section = "6.2", quote =
"An entity may wish to discover if a service implements the Multi-User Chat protocol; in order to do so, it " +
- "sends a service discovery information (\"disco#info\") query to the MUC service's JID. The service MUST " +
- "return its identity and the features it supports.")
+ "sends a service discovery information (\"disco#info\") query to the MUC service's JID. The service MUST " +
+ "return its identity and the features it supports.")
public void mucTestForDiscoveringFeatures() throws Exception {
- final DomainBareJid mucServiceAddress = mucManagerOne.getMucServiceDomains().get(0);
- DiscoverInfo info = mucManagerOne.getMucServiceDiscoInfo(mucServiceAddress);
- assertFalse(info.getIdentities().isEmpty(), "Expected the service discovery information for service " + mucServiceAddress + " to include identities (but it did not).");
- assertFalse(info.getFeatures().isEmpty(), "Expected the service discovery information for service " + mucServiceAddress + " to include features (but it did not).");
+ DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(conOne).discoverInfo(mucService);
+ assertFalse(info.getIdentities().isEmpty(), "Expected the service discovery information for service " + mucService + " to include identities (but it did not).");
+ assertFalse(info.getFeatures().isEmpty(), "Expected the service discovery information for service " + mucService + " to include features (but it did not).");
}
/**
@@ -120,6 +137,7 @@ public class MultiUserChatEntityIntegrationTest extends AbstractMultiUserChatInt
assertFalse(discoInfo.getIdentities().isEmpty(), "Expected the service discovery information for room " + mucAddress + " to include identities (but it did not).");
assertFalse(discoInfo.getFeatures().isEmpty(), "Expected the service discovery information for room " + mucAddress + " to include features (but it did not).");
+ assertTrue(discoInfo.getFeatures().stream().anyMatch(feature -> MultiUserChatConstants.NAMESPACE.equals(feature.getVar())), "Expected the service discovery information for room " + mucAddress + " to include the '" + MultiUserChatConstants.NAMESPACE + "' feature (but it did not).");
}
/**
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
index 930bbaf00..421109a00 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java
@@ -17,9 +17,7 @@
package org.jivesoftware.smackx.muc;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.concurrent.TimeoutException;
@@ -27,9 +25,6 @@ import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Message;
-import org.jivesoftware.smack.packet.Presence;
-
-import org.jivesoftware.smackx.muc.packet.MUCUser;
import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
import org.igniterealtime.smack.inttest.TestNotPossibleException;
@@ -48,62 +43,6 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
super(environment);
}
- /**
- * Asserts that when a user joins a room, they are themselves included on the list of users notified (self-presence).
- *
- * @throws Exception when errors occur
- */
- @SmackIntegrationTest(section = "7.2.2", quote =
- "... the service MUST also send presence from the new participant's occupant JID to the full JIDs of all the " +
- "occupants (including the new occupant)")
- public void mucJoinTest() throws Exception {
- EntityBareJid mucAddress = getRandomRoom("smack-inttest-join");
-
- MultiUserChat muc = mucManagerOne.getMultiUserChat(mucAddress);
- try {
- Presence reflectedJoinPresence = muc.join(Resourcepart.from("nick-one"));
-
- MUCUser mucUser = MUCUser.from(reflectedJoinPresence);
-
- assertNotNull(mucUser, "Expected, but unable, to create a MUCUser instance from reflected join presence: " + reflectedJoinPresence);
- assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Expected the reflected join presence of " + conOne.getUser() + " of room " + mucAddress + " to include 'presence-to-self' (" + MUCUser.Status.PRESENCE_TO_SELF_110 + ") but it did not.");
- assertEquals(mucAddress + "/nick-one", reflectedJoinPresence.getFrom().toString(), "Unexpected 'from' attribute value in the reflected join presence of " + conOne.getUser() + " of room " + mucAddress);
- assertEquals(conOne.getUser().asEntityFullJidIfPossible().toString(), reflectedJoinPresence.getTo().toString(), "Unexpected 'to' attribute value in the reflected join presence of " + conOne.getUser() + " of room " + mucAddress);
- } finally {
- tryDestroy(muc);
- }
- }
-
- /**
- * Asserts that when a user leaves a room, they are themselves included on the list of users notified (self-presence).
- *
- * @throws Exception when errors occur
- */
- @SmackIntegrationTest(section = "7.14", quote =
- "The service MUST then send a presence stanzas of type \"unavailable\" from the departing user's occupant " +
- "JID to the departing occupant's full JIDs, including a status code of \"110\" to indicate that this " +
- "notification is \"self-presence\"")
- public void mucLeaveTest() throws Exception {
- EntityBareJid mucAddress = getRandomRoom("smack-inttest-leave");
-
- MultiUserChat muc = mucManagerOne.getMultiUserChat(mucAddress);
- try {
- muc.join(Resourcepart.from("nick-one"));
-
- Presence reflectedLeavePresence = muc.leave();
-
- MUCUser mucUser = MUCUser.from(reflectedLeavePresence);
- assertNotNull(mucUser, "Expected, but unable, to create a MUCUser instance from reflected leave presence: " + reflectedLeavePresence);
-
- assertTrue(mucUser.getStatus().contains(MUCUser.Status.PRESENCE_TO_SELF_110), "Expected the reflected leave presence of " + conOne.getUser() + " of room " + mucAddress + " to include 'presence-to-self' (" + MUCUser.Status.PRESENCE_TO_SELF_110 + ") but it did not.");
- assertEquals(mucAddress + "/nick-one", reflectedLeavePresence.getFrom().toString(), "Unexpected 'from' attribute value in the reflected leave presence of " + conOne.getUser() + " of room " + mucAddress);
- assertEquals(conOne.getUser().asEntityFullJidIfPossible().toString(), reflectedLeavePresence.getTo().toString(), "Unexpected 'to' attribute value in the reflected leave presence of " + conOne.getUser() + " of room " + mucAddress);
- } finally {
- muc.join(Resourcepart.from("nick-one")); // We need to be in the room to destroy the room
- tryDestroy(muc);
- }
- }
-
@SmackIntegrationTest
public void mucTest() throws Exception {
EntityBareJid mucAddress = getRandomRoom("smack-inttest-message");
@@ -150,7 +89,7 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
EntityBareJid mucAddress = getRandomRoom("smack-inttest-destroy");
MultiUserChat muc = mucManagerOne.getMultiUserChat(mucAddress);
- muc.join(Resourcepart.from("nick-one"));
+ createMuc(muc, Resourcepart.from("one-" + randomString));
final SimpleResultSyncPoint mucDestroyed = new SimpleResultSyncPoint();
@@ -165,8 +104,8 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
muc.addUserStatusListener(userStatusListener);
// These would be a test implementation bug, not assertion failure.
- if (mucManagerOne.getJoinedRooms().size() != 1) {
- throw new IllegalStateException("Expected user to have joined a room.");
+ if (mucManagerOne.getJoinedRooms().stream().noneMatch(room -> room.equals(mucAddress))) {
+ throw new IllegalStateException("Expected user to have joined a room '" + mucAddress + "' (but does not appear to have done so).");
}
try {
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java
new file mode 100644
index 000000000..1125e320d
--- /dev/null
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java
@@ -0,0 +1,1102 @@
+/**
+ *
+ * Copyright 2015-2020 Florian Schmaus, 2021 Dan Caseley
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jivesoftware.smackx.muc;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeoutException;
+import java.util.stream.Collectors;
+
+import org.jivesoftware.smack.SmackException;
+import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smack.packet.Message;
+import org.jivesoftware.smack.packet.Presence;
+import org.jivesoftware.smack.packet.StanzaError;
+import org.jivesoftware.smack.sm.predicates.ForEveryMessage;
+import org.jivesoftware.smack.util.StringUtils;
+import org.jivesoftware.smackx.muc.packet.MUCItem;
+import org.jivesoftware.smackx.muc.packet.MUCUser;
+
+import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment;
+import org.igniterealtime.smack.inttest.TestNotPossibleException;
+import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
+import org.igniterealtime.smack.inttest.annotations.SpecificationReference;
+import org.igniterealtime.smack.inttest.util.MultiResultSyncPoint;
+import org.igniterealtime.smack.inttest.util.ResultSyncPoint;
+import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint;
+import org.jxmpp.jid.EntityBareJid;
+import org.jxmpp.jid.EntityFullJid;
+import org.jxmpp.jid.impl.JidCreate;
+import org.jxmpp.jid.parts.Resourcepart;
+
+@SpecificationReference(document = "XEP-0045")
+public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatIntegrationTest {
+
+ public MultiUserChatOccupantIntegrationTest(SmackIntegrationTestEnvironment environment)
+ throws SmackException.NoResponseException, XMPPException.XMPPErrorException,
+ SmackException.NotConnectedException, InterruptedException, TestNotPossibleException {
+ super(environment);
+ }
+
+ /**
+ * Asserts that when a user joins a room, all events are received, and in the correct order.
+ *
+ * @throws Exception when errors occur
+ */
+ @SmackIntegrationTest(section = "7.1 & 7.2.2", quote = "" +
+ "§ 7.1 The order of events involved in joining a room needs to be consistent so that clients can know which events to expect when. After a client sends presence to join a room, the MUC service MUST send it events in the following order: 1. In-room presence from other occupants 2. In-room presence from the joining entity itself (so-called \"self-presence\") 3. Room history (if any) 4. The room subject [...]" +
+ "§ 7.2.2 This self-presence MUST NOT be sent to the new occupant until the room has sent the presence of all other occupants to the new occupant ... The service MUST first send the complete list of the existing occupants to the new occupant and only then send the new occupant's own presence to the new occupant")
+ public void mucJoinEventOrderingTest() throws Exception {
+ EntityBareJid mucAddress = getRandomRoom("smack-inttest-eventordering");
+ final String mucSubject = "Subject smack-inttest-eventordering " + randomString;
+ final String mucMessage = "Message smack-inttest-eventordering " + randomString;
+
+ MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress);
+ MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress);
+
+ final Resourcepart nicknameOne = Resourcepart.from("one-" + randomString);
+ final Resourcepart nicknameTwo = Resourcepart.from("two-" + randomString);
+
+ createMuc(mucAsSeenByOne, nicknameOne);
+ mucAsSeenByOne.changeSubject(mucSubject); // Blocks until confirmed.
+
+ // Send and wait for the message to have been reflected, so that we can be sure it's part of the MUC history.
+ final SimpleResultSyncPoint messageReflectionSyncPoint = new SimpleResultSyncPoint();
+ mucAsSeenByOne.addMessageListener(message -> {
+ if (message.getBody().equals(mucMessage)) {
+ messageReflectionSyncPoint.signal();
+ }
+ });
+
+ mucAsSeenByOne.sendMessage(mucMessage);
+ messageReflectionSyncPoint.waitForResult(timeout);
+
+ final ResultSyncPoint subjectResultSyncPoint = new ResultSyncPoint<>();
+ List
* It is possible to not only print the raw sent and received stanzas but also the interpreted
- * packets by Smack. By default interpreted packets won't be printed. To enable this feature
+ * packets by Smack. By default,interpreted packets won't be printed. To enable this feature
* just change the printInterpreted static variable to true.
*
*/
diff --git a/smack-core/build.gradle b/smack-core/build.gradle
index f449ec5b7..d29c04d80 100644
--- a/smack-core/build.gradle
+++ b/smack-core/build.gradle
@@ -28,7 +28,7 @@ dependencies {
testFixturesApi "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
testFixturesApi "org.xmlunit:xmlunit-core:$xmlUnitVersion"
- // Explictily add assertj-core which is a dependency of
+ // Explicitly add assertj-core which is a dependency of
// xmlunit-assertj, but gradle fails to resolves it with:
// Execution failed for task ':smack-core:compileTestJava'.
// > Could not resolve all files for configuration ':smack-core:testCompileClasspath'.
diff --git a/smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java b/smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java
index 75b4f6915..bcded200c 100644
--- a/smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java
+++ b/smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java
@@ -60,7 +60,7 @@ public class MessageTest extends SmackTestCase {
}
Message message = (Message) collector.nextResult(2500);
- assertNotNull("Message not recieved from remote user", message);
+ assertNotNull("Message not received from remote user", message);
}
/**
diff --git a/smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java b/smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java
index 601540abe..ae25506ba 100644
--- a/smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java
+++ b/smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java
@@ -487,7 +487,7 @@ public abstract class SmackTestCase extends TestCase {
}
/**
- * Returns the name of the configuration file related to this test case. By default all
+ * Returns the name of the configuration file related to this test case. By default,all
* the test cases will use the same configuration file. However, it's possible to override the
* default configuration by providing a file of the form .xml
* (e.g. RosterTest.xml).
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
index 2b2dd5ee8..ae24f7f2b 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
@@ -128,7 +128,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
import org.jxmpp.util.XmppStringUtils;
/**
- * This abstract class is commonly used as super class for XMPP connection mechanisms like TCP and BOSH. Hence it
+ * This abstract class is commonly used as super class for XMPP connection mechanisms like TCP and BOSH. Hence, it
* provides the methods for connection state management, like {@link #connect()}, {@link #login()} and
* {@link #disconnect()} (which are deliberately not provided by the {@link XMPPConnection} interface).
*
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AsyncButOrdered.java b/smack-core/src/main/java/org/jivesoftware/smack/AsyncButOrdered.java
index 526e3cd2e..5788370ff 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/AsyncButOrdered.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/AsyncButOrdered.java
@@ -53,14 +53,14 @@ import java.util.concurrent.Executor;
public class AsyncButOrdered {
/**
- * A map with the currently pending runnables for a given key. Note that this is a weak hash map so we do not have
- * to take care of removing the keys ourselfs from the map.
+ * A map with the currently pending runnables for a given key. Note that this is a weak hash map, so we do not have
+ * to take care of removing the keys ourselves from the map.
*/
private final Map> pendingRunnables = new WeakHashMap<>();
/**
* A marker map if there is an active thread for the given key. Holds the responsible handler thread if one is
- * active, otherwise the key is non-existend in the map.
+ * active, otherwise the key is non-existent in the map.
*/
private final Map threadActiveMap = new HashMap<>();
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
index 9561a158d..11e931f1a 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
@@ -88,7 +88,7 @@ import org.minidns.util.InetAddressUtil;
/**
* The connection configuration used for XMPP client-to-server connections. A well configured XMPP service will
* typically only require you to provide two parameters: The XMPP address, also known as the JID, of the user and the
- * password. All other configuration parameters could ideally be determined automatically by Smack. Hence it is often
+ * password. All other configuration parameters could ideally be determined automatically by Smack. Hence, it is often
* enough to call {@link Builder#setXmppAddressAndPassword(CharSequence, String)}.
*
* Technically there are typically at least two parameters required: Some kind of credentials for authentication. And
@@ -248,7 +248,7 @@ public abstract class ConnectionConfiguration {
stanzaIdSourceFactory = builder.stanzaIdSourceFactory;
- // If the enabledSaslmechanisms are set, then they must not be empty
+ // If the enabledSaslMechanisms are set, then they must not be empty
assert enabledSaslMechanisms == null || !enabledSaslMechanisms.isEmpty();
}
@@ -267,7 +267,7 @@ public abstract class ConnectionConfiguration {
context = SSLContext.getInstance("TLS");
}
- // TODO: Remove the block below once we removed setKeystorePath(), setKeystoreType(), setCallbackHanlder() and
+ // TODO: Remove the block below once we removed setKeystorePath(), setKeystoreType(), setCallbackHandler() and
// setPKCS11Library() in the builder, and all related fields and the parameters of this function.
if (keyManagers == null) {
keyManagers = Builder.getKeyManagersFrom(keystoreType, keystorePath, callbackHandler, pkcs11Library);
@@ -583,7 +583,7 @@ public abstract class ConnectionConfiguration {
* Returns true if the connection is going to use stream compression. Stream compression
* will be requested after TLS was established (if TLS was enabled) and only if the server
* offered stream compression. With stream compression network traffic can be reduced
- * up to 90%. By default compression is disabled.
+ * up to 90%. By default,compression is disabled.
*
* @return true if the connection is going to use stream compression.
*/
@@ -592,7 +592,7 @@ public abstract class ConnectionConfiguration {
}
/**
- * Check if the given SASL mechansism is enabled in this connection configuration.
+ * Check if the given SASL mechanism is enabled in this connection configuration.
*
* @param saslMechanism TODO javadoc me please
* @return true if the given SASL mechanism is enabled, false otherwise.
@@ -607,7 +607,7 @@ public abstract class ConnectionConfiguration {
/**
* Return the explicitly enabled SASL mechanisms. May return null if no SASL mechanisms where
- * explicitly enabled, i.e. all SALS mechanisms supported and announced by the service will be considered.
+ * explicitly enabled, i.e. all SASL mechanisms supported and announced by the service will be considered.
*
* @return the enabled SASL mechanisms or null.
*/
@@ -1090,8 +1090,7 @@ public abstract class ConnectionConfiguration {
}
/**
- * Sets if an initial available presence will be sent to the server. By default
- * an available presence will be sent to the server indicating that this presence
+ * Sets if an initial available presence will be sent to the server. By default, * an available presence will be sent to the server indicating that this presence
* is not online and available to receive messages. If you want to log in without
* being 'noticed' then pass a false value.
*
@@ -1266,7 +1265,7 @@ public abstract class ConnectionConfiguration {
* Sets if the connection is going to use compression (default false).
*
* Compression is only activated if the server offers compression. With compression network
- * traffic can be reduced up to 90%. By default compression is disabled.
+ * traffic can be reduced up to 90%. By default,compression is disabled.
*
* @param compressionEnabled if the connection is going to use compression on the HTTP level.
* @return a reference to this object.
@@ -1324,7 +1323,7 @@ public abstract class ConnectionConfiguration {
} else {
InputStream stream = TLSUtils.getDefaultTruststoreStreamIfPossible();
try {
- // Note that PKCS12 keystores need a password one some Java platforms. Hence we try the famous
+ // Note that PKCS12 keystores need a password one some Java platforms. Hence, we try the famous
// 'changeit' here. See https://bugs.openjdk.java.net/browse/JDK-8194702
char[] password = "changeit".toCharArray();
try {
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java b/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java
index 4685bf4af..7d545bb45 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java
@@ -53,7 +53,7 @@ import org.jxmpp.jid.EntityBareJid;
*
*
Once TLS has been negotiated (i.e. the connection has been secured) it is possible to
* register with the server or authenticate using SASL. If the
- * server supports SASL then Smack will try to authenticate using SASL..
+ * server supports SASL then Smack will try to authenticate using SASL.
*
*
The server may support many SASL mechanisms to use for authenticating. Out of the box
* Smack provides several SASL mechanisms, but it is possible to register new SASL Mechanisms. Use
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/Smack.java b/smack-core/src/main/java/org/jivesoftware/smack/Smack.java
index 6608bba4b..daa7a18b4 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/Smack.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/Smack.java
@@ -30,7 +30,7 @@ public class Smack {
public static final String SMACK_PACKAGE = SMACK_ORG + ".smack";
/**
- * Returns the Smack version information, eg "1.3.0".
+ * Returns the Smack version information, e.g."1.3.0".
*
* @return the Smack version information.
*/
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java
index f3316c8ed..ef1101cff 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java
@@ -102,7 +102,7 @@ public final class SmackConfiguration {
private static HostnameVerifier defaultHostnameVerififer;
/**
- * Returns the Smack version information, eg "1.3.0".
+ * Returns the Smack version information, e.g."1.3.0".
*
* @return the Smack version information.
* @deprecated use {@link Smack#getVersion()} instead.
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
index f7543e724..cbf05cc6e 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
@@ -96,7 +96,7 @@ import org.jxmpp.jid.EntityFullJid;
*
other - e.g., {@link #addStanzaListener(StanzaListener, StanzaFilter)}
*
*
- * Asynchronous callbacks are run decoupled from the connections main event loop. Hence a callback triggered by
+ * Asynchronous callbacks are run decoupled from the connections main event loop. Hence, a callback triggered by
* stanza B may (appear to) invoked before a callback triggered by stanza A, even though stanza A arrived before B.
*
*
@@ -242,7 +242,7 @@ public interface XMPPConnection {
*
*
* @param stanza the stanza to send.
- * @return {@code true} if the stanza was successfully scheduled to be send, {@code false} otherwise.
+ * @return {@code true} if the stanza was successfully scheduled to be sent, {@code false} otherwise.
* @throws NotConnectedException if the connection is not connected.
* @since 4.4.0
* @deprecated use {@link #sendStanzaNonBlocking(Stanza)} instead.
@@ -265,7 +265,7 @@ public interface XMPPConnection {
* @param stanza the stanza to send.
* @param timeout how long to wait before giving up, in units of {@code unit}.
* @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter.
- * @return {@code true} if the stanza was successfully scheduled to be send, {@code false} otherwise.
+ * @return {@code true} if the stanza was successfully scheduled to be sent, {@code false} otherwise.
* @throws NotConnectedException if the connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
* @since 4.4.0
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/XmppInputOutputFilter.java b/smack-core/src/main/java/org/jivesoftware/smack/XmppInputOutputFilter.java
index 97fdff246..4f0c68b0a 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/XmppInputOutputFilter.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/XmppInputOutputFilter.java
@@ -57,8 +57,8 @@ public interface XmppInputOutputFilter {
}
/**
- * The returned {@link ByteBuffer} is going to get fliped by the caller. The callee must not flip the buffer.
- * @param inputData the data this methods needs to process.
+ * The returned {@link ByteBuffer} is going to get flipped by the caller. The callee must not flip the buffer.
+ * @param inputData the data this method needs to process.
* @return a {@link ByteBuffer} or {@code null} if no data could be produced.
* @throws IOException in case an I/O exception occurs.
*/
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/c2s/ModularXmppClientToServerConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/c2s/ModularXmppClientToServerConnection.java
index b24b00704..495720deb 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/c2s/ModularXmppClientToServerConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/c2s/ModularXmppClientToServerConnection.java
@@ -390,7 +390,7 @@ public final class ModularXmppClientToServerConnection extends AbstractXMPPConne
// Ignore successorStateVertex if the only way to the final state is via the initial state. This happens
// typically if we are in the ConnectedButUnauthenticated state on the way to ResourceboundAndAuthenticated,
- // where we do not want to walk via InstantShutdown/Shtudown in a cycle over the initial state towards this
+ // where we do not want to walk via InstantShutdown/Shutdown in a cycle over the initial state towards this
// state.
if (walkStateGraphContext.wouldCauseCycle(successorStateVertex)) {
// Ignore this successor.
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/datatypes/UInt16.java b/smack-core/src/main/java/org/jivesoftware/smack/datatypes/UInt16.java
index 271de8cbc..8df4cd2f4 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/datatypes/UInt16.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/datatypes/UInt16.java
@@ -19,7 +19,7 @@ package org.jivesoftware.smack.datatypes;
import org.jivesoftware.smack.util.NumberUtil;
/**
- * A number representing an unsigned 16-bit integer. Can be used for values with the XML schema type "xs:unsingedShort".
+ * A number representing an unsigned 16-bit integer. Can be used for values with the XML schema type "xs:unsignedShort".
*/
public final class UInt16 extends Scalar implements Comparable {
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/debugger/ConsoleDebugger.java b/smack-core/src/main/java/org/jivesoftware/smack/debugger/ConsoleDebugger.java
index a8ef6c00a..12d140aad 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/debugger/ConsoleDebugger.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/debugger/ConsoleDebugger.java
@@ -28,7 +28,7 @@ import org.jivesoftware.smack.util.ExceptionUtil;
* even block the thread since only one thread may print at a time.
*
* It is possible to not only print the raw sent and received stanzas but also the interpreted
- * packets by Smack. By default interpreted packets won't be printed. To enable this feature
+ * packets by Smack. By default,interpreted packets won't be printed. To enable this feature
* just change the printInterpreted static variable to true.
*
*
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/debugger/JulDebugger.java b/smack-core/src/main/java/org/jivesoftware/smack/debugger/JulDebugger.java
index db0772271..015bb813b 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/debugger/JulDebugger.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/debugger/JulDebugger.java
@@ -27,7 +27,7 @@ import org.jivesoftware.smack.XMPPConnection;
* even block the thread since only one thread may print at a time.
*
* It is possible to not only print the raw sent and received stanzas but also the interpreted
- * packets by Smack. By default interpreted packets won't be printed. To enable this feature
+ * packets by Smack. By default,interpreted packets won't be printed. To enable this feature
* just change the printInterpreted static variable to true.
*
*
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java b/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
index 82ca10b62..4f936b72d 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
@@ -57,7 +57,7 @@ public abstract class SmackDebugger {
*
* @param user the user@host/resource that has just logged in
*/
- // TODO: Should be replaced with a connection listener authenticed().
+ // TODO: Should be replaced with a connection listener authenticated().
public abstract void userHasLogged(EntityFullJid user);
/**
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/filter/package-info.java b/smack-core/src/main/java/org/jivesoftware/smack/filter/package-info.java
index 01f2e0461..c130b93ff 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/filter/package-info.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/filter/package-info.java
@@ -23,7 +23,7 @@
*
{@link StanzaIdFilter}: filters for stanzas with a particular stanza ID
*
{@link ToMatchesFilter}: filters for stanzas that are sent to a particular address
*
{@link FromMatchesFilter}: filters for stanzas that are sent from a particular address
- *
{@link ExtensionElementFilter}: filters for stanzas that have a particular stanza exentsion element
+ *
{@link ExtensionElementFilter}: filters for stanzas that have a particular stanza extension element
*
{@link AndFilter}: implements the logical AND operation over two or more filters
*
{@link OrFilter}: implements the logical OR operation over two or more filters
*
{@link NotFilter}: implements the logical NOT operation on a filter
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptor.java b/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptor.java
index 8f399480e..29c298c76 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptor.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptor.java
@@ -118,7 +118,7 @@ public abstract class StateDescriptor {
if (stateClassConstructor != null) {
stateClassConstructor.setAccessible(true);
} else {
- // TODO: Add validation check that if stateClassConstructor is 'null' the cosntructState() method is overriden.
+ // TODO: Add validation check that if stateClassConstructor is 'null' the constructState() method is overridden.
}
String className = getClass().getSimpleName();
@@ -155,7 +155,7 @@ public abstract class StateDescriptor {
clazz = Class.forName(clazzName);
} catch (ClassNotFoundException e) {
// The state descriptor class is not in classpath, which probably means that the smack module is not loaded
- // into the classpath. Hence we can silently ignore that.
+ // into the classpath. Hence, we can silently ignore that.
LOGGER.log(Level.FINEST, "Ignoring unknown state descriptor '" + clazzName + "'", e);
return;
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptorGraph.java b/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptorGraph.java
index 41bb29f59..224e1fab0 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptorGraph.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptorGraph.java
@@ -215,7 +215,7 @@ public class StateDescriptorGraph {
inferredForwardEdges.put(predecessor, backwardsEdge);
}
}
- // Ensure that the intial node has their successors inferred.
+ // Ensure that the initial node has their successors inferred.
for (Class extends StateDescriptor> inferredSuccessorOfInitialStateDescriptor : inferredForwardEdges.getAll(initialStatedescriptorClass)) {
initialNode.getElement().addSuccessor(inferredSuccessorOfInitialStateDescriptor);
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/ExtensionElement.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/ExtensionElement.java
index 5a7f00650..5f4ed1b6e 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/ExtensionElement.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/ExtensionElement.java
@@ -19,7 +19,7 @@ package org.jivesoftware.smack.packet;
/**
* Interface to represent XMPP extension elements. Unlike {@link XmlElement}, every non-abstract class that implements
* {@link ExtensionElement} must have a static final QNAME member of the type {@link javax.xml.namespace.QName}. This
- * allows type-safe functions like {@link StanzaView#getExtension(Class)}. Hence this is a marker interface.
+ * allows type-safe functions like {@link StanzaView#getExtension(Class)}. Hence, this is a marker interface.
*
* Use this class when implementing new extension elements when possible. This means that every instance of your
* implemented class must represent an XML element of the same qualified name.
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java
index 1881f4c23..a38386bfa 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java
@@ -95,7 +95,7 @@ public abstract class IQ extends Stanza implements IqView {
/**
* Sets the type of the IQ packet.
*
- * Since the type of an IQ must present, an IllegalArgmentException will be thrown when type is
+ * Since the type of an IQ must present, an IllegalArgumentException will be thrown when type is
* null.
*
*
@@ -182,7 +182,7 @@ public abstract class IQ extends Stanza implements IqView {
// Add the query section if there is one.
IQChildElementXmlStringBuilder iqChildElement = getIQChildElementBuilder(
new IQChildElementXmlStringBuilder(getChildElementName(), getChildElementNamespace(), null, xml.getXmlEnvironment()));
- // TOOD: Document the cases where iqChildElement is null but childElementName not. And if there are none, change
+ // TODO: Document the cases where iqChildElement is null but childElementName not. And if there are none, change
// the logic.
if (iqChildElement == null) {
return;
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Nonza.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Nonza.java
index a86a4e1db..ece665543 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Nonza.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Nonza.java
@@ -18,7 +18,7 @@
package org.jivesoftware.smack.packet;
/**
- * A Nonza, i.e everything that is not a stanza as defined
+ * A Nonza, i.e. everything that is not a stanza as defined
* RFC 6120 8. Stanzas are {@link Message}, {@link Presence} and {@link IQ}.
* Everything else should sublcass this class instead of {@link Stanza}.
*
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
index 7123e82f8..435a344b6 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
@@ -98,7 +98,7 @@ public abstract class Stanza implements StanzaView, TopLevelStreamElement {
protected Stanza(StanzaBuilder> stanzaBuilder) {
if (stanzaBuilder.stanzaIdSource != null) {
id = stanzaBuilder.stanzaIdSource.getNewStanzaId();
- // Note that some stanza ID sources, e.g. StanzaBuilder.PresenceBuilder.EMPTY return null here. Hence we
+ // Note that some stanza ID sources, e.g. StanzaBuilder.PresenceBuilder.EMPTY return null here. Hence, we
// only check that the returned string is not empty.
assert StringUtils.isNullOrNotEmpty(id);
usedStanzaIdSource = stanzaBuilder.stanzaIdSource;
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaBuilder.java
index ec8bdac3c..2cc2a20ed 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaBuilder.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaBuilder.java
@@ -87,9 +87,9 @@ public abstract class StanzaBuilder> implements Stanz
}
/**
- * Set the recipent address of the stanza.
+ * Set the recipient address of the stanza.
*
- * @param to whoe the stanza is being sent to.
+ * @param to whom the stanza is being sent.
* @return a reference to this builder.
* @throws XmppStringprepException if the provided character sequence is not a valid XMPP address.
* @see #to(Jid)
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/StreamError.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/StreamError.java
index f034be9d3..a58599de8 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/StreamError.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/StreamError.java
@@ -58,9 +58,9 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
* stream has been authenticated
*
policy-violation
the entity has violated some local service
* policy.
- *
remote-connection-failed
Rthe server is unable to properly connect
+ *
remote-connection-failed
the server is unable to properly connect
* to a remote entity.
- *
resource-constraint
Rthe server lacks the system resources necessary
+ *
resource-constraint
the server lacks the system resources necessary
* to service the stream.
*
restricted-xml
the entity has attempted to send restricted XML
* features.
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/provider/package-info.java b/smack-core/src/main/java/org/jivesoftware/smack/provider/package-info.java
index 5e40c5639..21fafdfcb 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/provider/package-info.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/provider/package-info.java
@@ -16,7 +16,7 @@
*/
/**
- * The Smack provider architecture is a system for plugging in custom XML parsing of staza extensions
+ * The Smack provider architecture is a system for plugging in custom XML parsing of stanza extensions
* ({@link org.jivesoftware.smack.packet.ExtensionElement}, {@link org.jivesoftware.smack.packet.IQ} stanzas and
* {@link org.jivesoftware.smack.packet.Nonza}. Hence, there are the the following providers:
*
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
index f1c00ef19..24330a6ac 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
@@ -358,7 +358,7 @@ public abstract class SASLMechanism implements Comparable {
* SASLprep the given String. The resulting String is in UTF-8.
*
* @param string the String to sasl prep.
- * @return the given String SASL preped
+ * @return the given String SASL prepped
* @see RFC 4013 - SASLprep: Stringprep Profile for User Names and Passwords
*/
protected static String saslPrep(String string) {
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/MAC.java b/smack-core/src/main/java/org/jivesoftware/smack/util/MAC.java
index 4d78d24f8..df177204e 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/MAC.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/MAC.java
@@ -33,7 +33,7 @@ public class MAC {
HMAC_SHA1 = Mac.getInstance(HMACSHA1);
}
catch (NoSuchAlgorithmException e) {
- // Smack wont be able to function normally if this exception is thrown, wrap it into
+ // Smack won't be able to function normally if this exception is thrown, wrap it into
// an ISE and make the user aware of the problem.
throw new IllegalStateException(e);
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/MD5.java b/smack-core/src/main/java/org/jivesoftware/smack/util/MD5.java
index 26c0547fd..d81c4de5a 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/MD5.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/MD5.java
@@ -31,7 +31,7 @@ public class MD5 {
MD5_DIGEST = MessageDigest.getInstance(StringUtils.MD5);
}
catch (NoSuchAlgorithmException e) {
- // Smack wont be able to function normally if this exception is thrown, wrap it into
+ // Smack won't be able to function normally if this exception is thrown, wrap it into
// an ISE and make the user aware of the problem.
throw new IllegalStateException(e);
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
index 042402299..c04514075 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
@@ -230,7 +230,7 @@ public class PacketParserUtils {
// Assume this is the end tag of the start tag at the
// beginning of this method. Typical examples where this
// happens are body elements containing the empty string,
- // ie. , which appears to be valid XMPP, or a
+ // i.e. , which appears to be valid XMPP, or a
// least it's not explicitly forbidden by RFC 6121 5.2.3
return "";
} else {
@@ -850,7 +850,7 @@ public class PacketParserUtils {
throws XmlPullParserException, IOException {
ParserUtils.assertAtStartTag(parser);
assert parser.getNamespace().equals(StartTls.NAMESPACE);
- int initalDepth = parser.getDepth();
+ int initialDepth = parser.getDepth();
boolean required = false;
outerloop: while (true) {
XmlPullParser.Event event = parser.next();
@@ -864,7 +864,7 @@ public class PacketParserUtils {
}
break;
case END_ELEMENT:
- if (parser.getDepth() == initalDepth) {
+ if (parser.getDepth() == initialDepth) {
break outerloop;
}
break;
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java
index 64c18a7fb..12ce7da7d 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java
@@ -146,7 +146,7 @@ public class ParserUtils {
}
/**
- * Prase a string to a boolean value as per "xs:boolean". Valid input strings are "true", "1" for true, and "false", "0" for false.
+ * Phrase a string to a boolean value as per "xs:boolean". Valid input strings are "true", "1" for true, and "false", "0" for false.
*
* @param booleanString the input string.
* @return the boolean representation of the input string
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/SHA1.java b/smack-core/src/main/java/org/jivesoftware/smack/util/SHA1.java
index 89144530b..3c7d53ac4 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/SHA1.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/SHA1.java
@@ -31,7 +31,7 @@ public class SHA1 {
SHA1_DIGEST = MessageDigest.getInstance(StringUtils.SHA1);
}
catch (NoSuchAlgorithmException e) {
- // Smack wont be able to function normally if this exception is thrown, wrap it into
+ // Smack won't be able to function normally if this exception is thrown, wrap it into
// an ISE and make the user aware of the problem.
throw new IllegalStateException(e);
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java
index 5ebe4c116..041ddde5a 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java
@@ -343,7 +343,7 @@ public class StringUtils {
try {
randomString(charBuffer, random, alphabet, numRandomChars);
} catch (IOException e) {
- // This should never happen if we calcuate the buffer size correctly.
+ // This should never happen if we calculate the buffer size correctly.
throw new AssertionError(e);
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/dns/package-info.java b/smack-core/src/main/java/org/jivesoftware/smack/util/dns/package-info.java
index f06cdab84..1fb7e9b3b 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/dns/package-info.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/dns/package-info.java
@@ -61,8 +61,8 @@
*
*
Best Practices
*
- * We recommend that applications using Smack's DNSSEC API do not ask the user if DNSSEC is avaialble. Instead they
- * should check for DNSSEC suport on every connection attempt. Once DNSSEC support has been discovered, the application
+ * We recommend that applications using Smack's DNSSEC API do not ask the user if DNSSEC is available. Instead they
+ * should check for DNSSEC support on every connection attempt. Once DNSSEC support has been discovered, the application
* should use the `needsDnssec` mode for all future connection attempts. The same scheme can be applied when using DANE.
* This approach is similar to the scheme established by to HTTP Strict
* Transport Security" (HSTS, RFC 6797.
diff --git a/smack-core/src/testFixtures/java/org/jivesoftware/smack/DummyConnection.java b/smack-core/src/testFixtures/java/org/jivesoftware/smack/DummyConnection.java
index 7e105d58b..7df852975 100644
--- a/smack-core/src/testFixtures/java/org/jivesoftware/smack/DummyConnection.java
+++ b/smack-core/src/testFixtures/java/org/jivesoftware/smack/DummyConnection.java
@@ -39,9 +39,9 @@ import org.jxmpp.stringprep.XmppStringprepException;
* A dummy implementation of {@link XMPPConnection}, intended to be used during
* unit tests.
*
- * Instances store any packets that are delivered to be send using the
+ * Instances store any packets that are delivered to be sent using the
* {@link #sendStanza(Stanza)} method in a blocking queue. The content of this queue
- * can be inspected using {@link #getSentPacket()}. Typically these queues are
+ * can be inspected using {@link #getSentPacket()}. Typically, these queues are
* used to retrieve a message that was generated by the client.
*
* Packets that should be processed by the client to simulate a received stanza
diff --git a/smack-core/src/testFixtures/java/org/jivesoftware/smack/test/util/MemoryLeakTestUtil.java b/smack-core/src/testFixtures/java/org/jivesoftware/smack/test/util/MemoryLeakTestUtil.java
index 6746e8f13..1eccfd75a 100644
--- a/smack-core/src/testFixtures/java/org/jivesoftware/smack/test/util/MemoryLeakTestUtil.java
+++ b/smack-core/src/testFixtures/java/org/jivesoftware/smack/test/util/MemoryLeakTestUtil.java
@@ -41,7 +41,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
* Note that this test is based on the assumption that it is possible to trigger a full garbage collection run, which is
* not the case. See also this
* stackoverflow
- * question. Hence the {@link #triggerGarbageCollection()} method defined in this class is not portable and depends
+ * question. Hence, the {@link #triggerGarbageCollection()} method defined in this class is not portable and depends
* on implementation depended Java Virtual Machine behavior.
*
*
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hashes/HashManager.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hashes/HashManager.java
index b3f0c3db4..68aa79ba7 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hashes/HashManager.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hashes/HashManager.java
@@ -47,7 +47,7 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.hashes.element.HashElement;
/**
- * Manager that can be used to determine support for hash functions. By default the Manager announces support for
+ * Manager that can be used to determine support for hash functions. By default,the Manager announces support for
* XEP-0300, as well as for the recommended set of hash algorithms. Those contain SHA256, SHA384, SHA512, SHA3-256,
* SHA3-384, SHA3-512, BLAKE2B256, BLAKE2B384 and BLAKE2B512. Those algorithms got recommended here:
* https://xmpp.org/extensions/xep-0300.html#recommendations.
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/package-info.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/package-info.java
index 1b357afa8..9ca583637 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/package-info.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/package-info.java
@@ -103,7 +103,7 @@
* AbstractHttpOverXmpp.Data data = new AbstractHttpOverXmpp.Data(child);
*
* // create request
- * HttpOverXmppReq req = HttpOverXmppReq.buider()
+ * HttpOverXmppReq req = HttpOverXmppReq.builder()
* .setMethod(HttpMethod.POST)
* .setResource("/mailbox")
* .setHeaders(headers)
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/package-info.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/package-info.java
index 0b3803a4f..c4b261a27 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/package-info.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/iot/package-info.java
@@ -146,7 +146,7 @@
*
@@ -162,7 +162,7 @@
* Things can usually only be used by other things if they are friends. Since a
* thing normally can't decide on its own if an incoming friendship request
* should be granted or not, we can delegate this decision to a provisioning
- * service. Smack provides the `IoTProvisinoManager` to deal with friendship and
+ * service. Smack provides the `IoTProvisionManager` to deal with friendship and
* provisioning.
*
* The most important class is the {@link org.jivesoftware.smackx.message_markup.element.MarkupElement} class, which
- * contains a Builder to construct message markup..
+ * contains a Builder to construct message markup.
*
*
* To start creating a Message Markup Extension, call
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/reference/package-info.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/reference/package-info.java
index 821577179..fc8f020be 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/reference/package-info.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/reference/package-info.java
@@ -29,7 +29,7 @@
*
*
*
- * Message message = new Message("Alice is a realy nice person.");
+ * Message message = new Message("Alice is a really nice person.");
* BareJid alice = JidCreate.bareFrom("alice@capulet.lit");
* ReferenceManager.addMention(message, 0, 5, alice);
*
diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/eme/ExplicitMessageEncryptionElementTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/eme/ExplicitMessageEncryptionElementTest.java
index dc14db131..b9364b01f 100644
--- a/smack-experimental/src/test/java/org/jivesoftware/smackx/eme/ExplicitMessageEncryptionElementTest.java
+++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/eme/ExplicitMessageEncryptionElementTest.java
@@ -39,7 +39,7 @@ public class ExplicitMessageEncryptionElementTest extends SmackTestSuite {
public void addToMessageTest() {
Message message = StanzaBuilder.buildMessage().build();
- // Check inital state (no elements)
+ // Check initial state (no elements)
assertNull(ExplicitMessageEncryptionElement.from(message));
assertFalse(ExplicitMessageEncryptionElement.hasProtocol(message,
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl));
@@ -75,7 +75,7 @@ public class ExplicitMessageEncryptionElementTest extends SmackTestSuite {
assertTrue(ExplicitMessageEncryptionElement.hasProtocol(message,
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl));
- // Check, if adding additional OMEMO wont add another element
+ // Check, if adding additional OMEMO won't add another element
ExplicitMessageEncryptionElement.set(messageBuilder,
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.omemoVAxolotl);
diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/FileTransferTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/FileTransferTest.java
index b3ecc362a..fc9c6d933 100644
--- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/FileTransferTest.java
+++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/FileTransferTest.java
@@ -109,7 +109,7 @@ public class FileTransferTest extends SmackTestCase {
fail();
}
byte [] array = queue.take();
- assertEquals("Recieved file not equal to sent file.", testTransfer, array);
+ assertEquals("Received file not equal to sent file.", testTransfer, array);
}
diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/OfflineMessageManagerTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/OfflineMessageManagerTest.java
index 13d4bd23c..5efb0799a 100644
--- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/OfflineMessageManagerTest.java
+++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/OfflineMessageManagerTest.java
@@ -50,7 +50,7 @@ public class OfflineMessageManagerTest extends SmackTestCase {
/**
* While user2 is connected but unavailable, user1 sends 2 messages to user1. User2 then
* performs some "Flexible Offline Message Retrieval" checking the number of offline messages,
- * retriving the headers, then the real messages of the headers and finally removing the
+ * retrieving the headers, then the real messages of the headers and finally removing the
* loaded messages.
*/
public void testReadAndDelete() {
diff --git a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/ServiceDiscoveryManagerTest.java b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/ServiceDiscoveryManagerTest.java
index 5d56d85ba..71ba8d7d2 100644
--- a/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/ServiceDiscoveryManagerTest.java
+++ b/smack-extensions/src/integration-test/java/org/jivesoftware/smackx/ServiceDiscoveryManagerTest.java
@@ -90,7 +90,7 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
*/
public void testXHTMLFeature() {
// Check for local XHTML service support
- // By default the XHTML service support is enabled in all the connections
+ // By default,the XHTML service support is enabled in all the connections
assertTrue(XHTMLManager.isServiceEnabled(getConnection(0)));
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
// Check for XHTML support in connection1 from connection2
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/address/packet/MultipleAddresses.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/address/packet/MultipleAddresses.java
index fba5979ce..6f9e63e81 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/address/packet/MultipleAddresses.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/address/packet/MultipleAddresses.java
@@ -93,7 +93,7 @@ public class MultipleAddresses implements ExtensionElement {
/**
* Returns the list of addresses that matches the specified type. Examples of address
- * type are: TO, CC, BCC, etc..
+ * type are: TO, CC, BCC, etc.
*
* @param type Examples of address type are: TO, CC, BCC, etc.
* @return the list of addresses that matches the specified type.
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/blocking/BlockingCommandManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/blocking/BlockingCommandManager.java
index 6769c9f5b..330cfbc8c 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/blocking/BlockingCommandManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/blocking/BlockingCommandManager.java
@@ -44,13 +44,13 @@ import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jxmpp.jid.Jid;
/**
- * Block communications with contancts and other entities using XEP-0191.
+ * Block communications with contacts and other entities using XEP-0191.
* Allows to
*
*
Check push notifications support
*
Get blocking list
*
Block contact
- *
Unblock conact
+ *
Unblock contact
*
Unblock all
*
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java
index fe8323953..9d00ec626 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java
@@ -103,7 +103,7 @@ public final class BookmarkManager {
*
* @param name the name of the conference
* @param jid the jid of the conference
- * @param isAutoJoin whether or not to join this conference automatically on login
+ * @param isAutoJoin whether to join this conference automatically on login
* @param nickname the nickname to use for the user when joining the conference
* @param password the password to use for the user when joining the conference
* @throws XMPPErrorException thrown when there is an issue retrieving the current bookmarks from
@@ -166,7 +166,7 @@ public final class BookmarkManager {
* Returns an unmodifiable collection of all bookmarked urls.
*
* @return returns an unmodifiable collection of all bookmarked urls.
- * @throws XMPPErrorException thrown when there is a problem retriving bookmarks from the server.
+ * @throws XMPPErrorException thrown when there is a problem retrieving bookmarks from the server.
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
@@ -181,8 +181,8 @@ public final class BookmarkManager {
*
* @param URL the url of the bookmark
* @param name the name of the bookmark
- * @param isRSS whether or not the url is an rss feed
- * @throws XMPPErrorException thrown when there is an error retriving or saving bookmarks from or to
+ * @param isRSS whether the url is an RSS feed
+ * @throws XMPPErrorException thrown when there is an error retrieving or saving bookmarks from or to
* the server
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException if the XMPP connection is not connected.
@@ -210,7 +210,7 @@ public final class BookmarkManager {
* Removes a url from the bookmarks.
*
* @param bookmarkURL the url of the bookmark to remove
- * @throws XMPPErrorException thrown if there is an error retriving or saving bookmarks from or to
+ * @throws XMPPErrorException thrown if there is an error retrieving or saving bookmarks from or to
* the server.
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException if the XMPP connection is not connected.
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java
index 9061a5606..823df54e1 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java
@@ -511,7 +511,7 @@ public final class InBandBytestreamManager extends Manager implements Bytestream
}
/**
- * Returns the list of session IDs that should be ignored by the InitialtionListener
+ * Returns the list of session IDs that should be ignored by the InitiationListener
*
* @return list of session IDs
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java
index 673f7a989..a0dd45581 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java
@@ -139,7 +139,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
/* timeout for connecting to the SOCKS5 proxy selected by the target */
private int proxyConnectionTimeout = 10000;
- /* blacklist of errornous SOCKS5 proxies */
+ /* blacklist of erroneous SOCKS5 proxies */
private final Set proxyBlacklist = Collections.synchronizedSet(new HashSet());
/* remember the last proxy that worked to prioritize it */
@@ -390,7 +390,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
}
/**
- * Set whether or not the bytestream manager will annouce the local stream host(s), i.e. the local SOCKS5 proxy.
+ * Set whether the bytestream manager will announce the local stream host(s), i.e. the local SOCKS5 proxy.
*
* @param announceLocalStreamHost TODO javadoc me please
* @see #isAnnouncingLocalStreamHostEnabled()
@@ -580,7 +580,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
proxyInfo = serviceDiscoveryManager.discoverInfo(item.getEntityID());
}
catch (NoResponseException | XMPPErrorException e) {
- // blacklist errornous server
+ // blacklist erroneous server
proxyBlacklist.add(item.getEntityID());
continue;
}
@@ -627,7 +627,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
streamHosts.addAll(response.getStreamHosts());
}
catch (Exception e) {
- // blacklist errornous proxies
+ // blacklist erroneous proxies
this.proxyBlacklist.add(proxy);
}
}
@@ -796,7 +796,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
}
/**
- * Returns the list of session IDs that should be ignored by the InitialtionListener
+ * Returns the list of session IDs that should be ignored by the InitiationListener
*
* @return list of session IDs
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Client.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Client.java
index 7f80e8260..e4444c6ac 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Client.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Client.java
@@ -138,7 +138,7 @@ public class Socks5Client {
byte[] connectionRequest;
byte[] connectionResponse;
/*
- * use DataInputStream/DataOutpuStream to assure read and write is completed in a single
+ * use DataInputStream/DataOutputStream to assure read and write is completed in a single
* statement
*/
DataInputStream in = new DataInputStream(socket.getInputStream());
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java
index 64fc70451..c15cdf131 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java
@@ -91,7 +91,7 @@ import org.jxmpp.util.cache.LruCache;
* but XEP-0030 then XEP-0030 mechanisms are transparently used.
*
*
- * The caches used by Smack for Entity Capabilities is non-persisent per default. However, it is is also possible to set
+ * The caches used by Smack for Entity Capabilities is non-persistent per default. However, it is is also possible to set
* a persistent Entity Capabilities cache, which is recommended.
*
*
Examples
@@ -226,7 +226,7 @@ public final class EntityCapsManager extends Manager {
/**
* Get the Node version (node#ver) of a JID. Returns a String or null if
- * EntiyCapsManager does not have any information.
+ * EntityCapsManager does not have any information.
*
* @param jid TODO javadoc me please
* the user (Full JID)
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java
index 49bf9c0cd..4f4b0652b 100755
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java
@@ -654,7 +654,7 @@ public final class AdHocCommandManager extends Manager {
public AdHocCommandHandler getCommandInstance() throws InstantiationException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
String sessionId;
- // TODO: The code below contains a race condition. Use CopncurrentHashMap.computeIfAbsent() to remove the
+ // TODO: The code below contains a race condition. Use ConcurrentHashMap.computeIfAbsent() to remove the
// race condition once Smack's minimum Android API level 24 or higher.
int attempt = 0;
do {
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/delay/filter/DelayedStanzaFilter.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/delay/filter/DelayedStanzaFilter.java
index 054ed42cf..90c30f563 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/delay/filter/DelayedStanzaFilter.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/delay/filter/DelayedStanzaFilter.java
@@ -23,14 +23,14 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smackx.delay.DelayInformationManager;
/**
- * Filters stanza with delay information, ie. stanzas that got delayed for some reason
+ * Filters stanza with delay information, i.e. stanzas that got delayed for some reason
*/
public final class DelayedStanzaFilter implements StanzaFilter {
public static final StanzaFilter INSTANCE = new DelayedStanzaFilter();
/**
- * Filters stanzas that got not delayed, ie. have no delayed information
+ * Filters stanzas that got not delayed, i.e. have no delayed information
*/
public static final StanzaFilter NOT_DELAYED_STANZA = new NotFilter(INSTANCE);
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java
index 6e43fbc9a..520806d0c 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java
@@ -294,7 +294,7 @@ public final class ServiceDiscoveryManager extends Manager {
/**
* Returns all identities of this client as unmodifiable Collection.
*
- * @return all identies as set
+ * @return all identities as a set
*/
public Set getIdentities() {
Set res = new HashSet<>(identities);
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
index abe18f630..23be5dee5 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
@@ -215,7 +215,7 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
*
* @param category category the category to look for.
* @param type type the type to look for.
- * @return a list of Identites with the given category and type.
+ * @return a list of Identities with the given category and type.
*/
public List getIdentities(String category, String type) {
List res = new ArrayList<>(identities.size());
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java
index c09e9fcb2..9a17438d0 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java
@@ -51,7 +51,7 @@ import org.jivesoftware.smack.util.CloseableUtil;
* The second way that a file can be received through this class is by invoking
* the {@link #receiveFile(File)} method. This method returns immediately and
* takes as its parameter a file on the local file system where the file
- * recieved from the transfer will be put.
+ * received from the transfer will be put.
*
* @author Alexander Wenckus
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java
index adf7297e5..0fc025827 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java
@@ -52,7 +52,7 @@ public abstract class StreamNegotiator extends Manager {
}
/**
- * A event manager for stream initiation requests send to us.
+ * An event manager for stream initiation requests send to us.
*
* Those are typical XEP-45 Open or XEP-65 Bytestream IQ requests. The even key is in the format
* "initiationFrom + '\t' + streamId"
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/package-info.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/package-info.java
index 505394d1e..a05f6d56c 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/package-info.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/package-info.java
@@ -144,7 +144,7 @@
*
**isDone()** - Similar to getProgress() except it returns a _boolean_. If the state is rejected, canceled, error,
* or complete then true will be returned and false otherwise.
*
**getError()** - If there is an error during the file transfer this method will return the type of error that
- * occured.
+ * occurred.
*
*
Examples
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/geoloc/GeoLocationManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/geoloc/GeoLocationManager.java
index f29306251..eb91bec55 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/geoloc/GeoLocationManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/geoloc/GeoLocationManager.java
@@ -43,7 +43,7 @@ import org.jxmpp.jid.Jid;
*
* To publish a UserLocation, please use {@link #publishGeoLocation(GeoLocation)} method. This will publish the node.
*
- * To stop publishing a UserLocation, please use {@link #stopPublishingGeolocation()} method. This will send a disble publishing signal.
+ * To stop publishing a UserLocation, please use {@link #stopPublishingGeolocation()} method. This will send a disable publishing signal.
*
* To add a {@link PepEventListener} in order to remain updated with other users GeoLocation, use {@link #addGeoLocationListener(PepEventListener)} method.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/packet/PrivateData.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/packet/PrivateData.java
index 058b0c2d5..c6670c900 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/packet/PrivateData.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/iqprivate/packet/PrivateData.java
@@ -41,7 +41,7 @@ public interface PrivateData {
String getNamespace();
/**
- * Returns the XML reppresentation of the PrivateData.
+ * Returns the XML representation of the PrivateData.
*
* @return the private data as XML.
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/Jingle.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/Jingle.java
index ea36bcc31..4fb09922c 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/Jingle.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/Jingle.java
@@ -52,7 +52,7 @@ import org.jxmpp.jid.FullJid;
* | transport-info
* | transport-reject
* | transport-replace
- * │ initator (RECOMMENDED for session initiate, NOT RECOMMENDED otherwise, full JID, XEP-0166 § 7.1)
+ * │ initiator (RECOMMENDED for session initiate, NOT RECOMMENDED otherwise, full JID, XEP-0166 § 7.1)
* │ responder (RECOMMENDED for session accept, NOT RECOMMENDED otherwise, full JID. XEP-0166 § 7.1)
* │ sid (REQUIRED, SHOULD match XML Nmtoken production)
* │
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContent.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContent.java
index ab5680c1d..702183dd2 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContent.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/element/JingleContent.java
@@ -71,7 +71,7 @@ public final class JingleContent implements XmlElement {
private final JingleContentTransport transport;
/**
- * Creates a content description..
+ * Creates a content description.
*/
private JingleContent(Creator creator, String disposition, String name, Senders senders,
JingleContentDescription description, JingleContentTransport transport) {
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/package-info.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/package-info.java
index 45a9fe3e9..a5ea271a5 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/package-info.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/package-info.java
@@ -70,7 +70,7 @@ chat.sendMessage(message);
*
*
When you send a Java object as a property, only clients running Java will be able to interpret the data. So,
* consider using a series of primitive values to transfer data instead.
- *
Objects sent as property values must implement Serialiable. Additionally, both the sender and receiver must have
+ *
Objects sent as property values must implement Serializable. Additionally, both the sender and receiver must have
* identical versions of the class, or a serialization exception will occur when de-serializing the object.
*
Serialized objects can potentially be quite large, which will use more bandwidth and server resources.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Affiliate.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Affiliate.java
index 3e3648f26..d3e034c6c 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Affiliate.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Affiliate.java
@@ -55,10 +55,10 @@ public class Affiliate {
}
/**
- * Returns the affiliation of the afffiliated user. Possible affiliations are: "owner", "admin",
+ * Returns the affiliation of the affiliated user. Possible affiliations are: "owner", "admin",
* "member", "outcast". This information will always be available.
*
- * @return the affiliation of the afffiliated user.
+ * @return the affiliation of the affiliated user.
*/
public MUCAffiliation getAffiliation() {
return affiliation;
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java
index c9d809cd2..a496077bc 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java
@@ -25,7 +25,7 @@ import org.jxmpp.jid.parts.Resourcepart;
* Default implementation of the ParticipantStatusListener interface.
*
* This class does not provide any behavior by default. It just avoids having
- * to implement all the inteface methods if the user is only interested in implementing
+ * to implement all the interface methods if the user is only interested in implementing
* some of the methods.
*
* @author Gaston Dombiak
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java
index e90b6993a..44e396fb0 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java
@@ -23,7 +23,7 @@ import org.jxmpp.jid.Jid;
* Default implementation of the UserStatusListener interface.
*
* This class does not provide any behavior by default. It just avoids having
- * to implement all the inteface methods if the user is only interested in implementing
+ * to implement all the interface methods if the user is only interested in implementing
* some of the methods.
*
* @author Gaston Dombiak
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java
index 1c989c8bc..b847cd025 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucConfigFormManager.java
@@ -285,7 +285,7 @@ public class MucConfigFormManager {
/**
- * Check if the room supports its visibility being controlled vioa configuration.
+ * Check if the room supports its visibility being controlled via configuration.
*
* @return true if supported, false if not.
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
index 9383d9e28..fbbc1fdc5 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
@@ -351,7 +351,7 @@ public class MultiUserChat {
* @throws NoResponseException if there was no response from the remote entity.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws InterruptedException if the calling thread was interrupted.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
* @see XEP-45 7.2 Entering a Room
*/
private Presence enter(MucEnterConfiguration conf) throws NotConnectedException, NoResponseException,
@@ -365,7 +365,7 @@ public class MultiUserChat {
// field is in the form "roomName@service/nickname"
Presence joinPresence = conf.getJoinPresence(this);
- // Setup the messageListeners and presenceListeners *before* the join presence is send.
+ // Set up the messageListeners and presenceListeners *before* the join presence is sent.
connection.addStanzaListener(messageListener, fromRoomGroupchatFilter);
StanzaFilter presenceFromRoomFilter = new AndFilter(fromRoomFilter,
StanzaTypeFilter.PRESENCE,
@@ -401,12 +401,12 @@ public class MultiUserChat {
StanzaCollector presenceStanzaCollector = null;
final Presence reflectedSelfPresence;
try {
- // This stanza collector will collect the final self presence from the MUC, which also signals that we have successful entered the MUC.
+ // This stanza collector will collect the final self presence from the MUC, which also signals that we have successfully entered the MUC.
StanzaCollector selfPresenceCollector = connection.createStanzaCollectorAndSend(responseFilter, joinPresence);
- StanzaCollector.Configuration presenceStanzaCollectorConfguration = StanzaCollector.newConfiguration().setCollectorToReset(
+ StanzaCollector.Configuration presenceStanzaCollectorConfiguration = StanzaCollector.newConfiguration().setCollectorToReset(
selfPresenceCollector).setStanzaFilter(presenceFromRoomFilter);
// This stanza collector is used to reset the timeout of the selfPresenceCollector.
- presenceStanzaCollector = connection.createStanzaCollector(presenceStanzaCollectorConfguration);
+ presenceStanzaCollector = connection.createStanzaCollector(presenceStanzaCollectorConfiguration);
reflectedSelfPresence = selfPresenceCollector.nextResultOrThrow(conf.getTimeout());
}
catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {
@@ -423,15 +423,15 @@ public class MultiUserChat {
synchronized (presenceListener) {
// Only continue after we have received *and* processed the reflected self-presence. Since presences are
// handled in an extra listener, we may return from enter() without having processed all presences of the
- // participants, resulting in a e.g. to low participant counter after enter(). Hence we wait here until the
+ // participants, resulting in a e.g. to low participant counter after enter(). Hence, we wait here until the
// processing is done.
while (!processedReflectedSelfPresence) {
presenceListener.wait();
}
}
- // This presence must be send from a full JID. We use the resourcepart of this JID as nick, since the room may
- // performed roomnick rewriting
+ // This presence must be sent from a full JID. We use the resourcepart of this JID as nick, since the room may
+ // have performed roomnick rewriting
Resourcepart receivedNickname = reflectedSelfPresence.getFrom().getResourceOrThrow();
setNickname(receivedNickname);
@@ -481,7 +481,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws MucAlreadyJoinedException if already joined the Multi-User Chat.7y
* @throws MissingMucCreationAcknowledgeException if there MUC creation was not acknowledged by the service.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public synchronized MucCreateConfigFormHandle create(Resourcepart nickname) throws NoResponseException,
XMPPErrorException, InterruptedException, MucAlreadyJoinedException,
@@ -515,7 +515,7 @@ public class MultiUserChat {
* @throws InterruptedException if the calling thread was interrupted.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws MucAlreadyJoinedException if already joined the Multi-User Chat.7y
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException {
@@ -537,7 +537,7 @@ public class MultiUserChat {
* @throws InterruptedException if the calling thread was interrupted.
* @throws MucAlreadyJoinedException if the MUC is already joined
* @throws NotConnectedException if the XMPP connection is not connected.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public synchronized MucCreateConfigFormHandle createOrJoin(MucEnterConfiguration mucEnterConfiguration)
throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException {
@@ -610,7 +610,7 @@ public class MultiUserChat {
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public MucCreateConfigFormHandle createOrJoinIfNecessary(Resourcepart nickname, String password) throws NoResponseException,
XMPPErrorException, NotConnectedException, InterruptedException, NotAMucServiceException {
@@ -646,7 +646,7 @@ public class MultiUserChat {
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public Presence join(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException, NotAMucServiceException {
@@ -676,7 +676,7 @@ public class MultiUserChat {
* @throws InterruptedException if the calling thread was interrupted.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws NoResponseException if there was no response from the server.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public void join(Resourcepart nickname, String password) throws XMPPErrorException, InterruptedException, NoResponseException, NotConnectedException, NotAMucServiceException {
MucEnterConfiguration.Builder builder = getEnterConfigurationBuilder(nickname).withPassword(
@@ -709,7 +709,7 @@ public class MultiUserChat {
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
*/
public synchronized Presence join(MucEnterConfiguration mucEnterConfiguration)
throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException, NotAMucServiceException {
@@ -833,9 +833,9 @@ public class MultiUserChat {
/**
* Returns the room's configuration form that the room's owner can use.
* The configuration form allows to set the room's language,
- * enable logging, specify room's type, etc..
+ * enable logging, specify room's type, etc.
*
- * @return the Form that contains the fields to complete together with the instrucions or
+ * @return the Form that contains the fields to complete together with the instructions or
* null if no configuration is possible.
* @throws XMPPErrorException if an error occurs asking the configuration form for the room.
* @throws NoResponseException if there was no response from the server.
@@ -889,7 +889,7 @@ public class MultiUserChat {
* error to the user (error code 405).
*
* @return the registration Form that contains the fields to complete together with the
- * instrucions or null if no registration is possible.
+ * instructions or null if no registration is possible.
* @throws XMPPErrorException if an error occurs asking the registration form for the room or a
* 405 error if the user is not allowed to register with the room.
* @throws NoResponseException if there was no response from the server.
@@ -1598,7 +1598,7 @@ public class MultiUserChat {
/**
* Grants moderator privileges to participants or visitors. Room administrators may grant
* moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite
- * other users, modify room's subject plus all the partcipants privileges.
+ * other users, modify room's subject plus all the participant privileges.
*
* @param nicknames the nicknames of the occupants to grant moderator privileges.
* @throws XMPPErrorException if an error occurs granting moderator privileges to a user.
@@ -1613,7 +1613,7 @@ public class MultiUserChat {
/**
* Grants moderator privileges to a participant or visitor. Room administrators may grant
* moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite
- * other users, modify room's subject plus all the partcipants privileges.
+ * other users, modify room's subject plus all the participant privileges.
*
* @param nickname the nickname of the occupant to grant moderator privileges.
* @throws XMPPErrorException if an error occurs granting moderator privileges to a user.
@@ -2171,7 +2171,7 @@ public class MultiUserChat {
/**
* Polls for and returns the next message, or null if there isn't
* a message immediately available. This method provides significantly different
- * functionalty than the {@link #nextMessage()} method since it's non-blocking.
+ * functionality than the {@link #nextMessage()} method since it's non-blocking.
* In other words, the method call will always return immediately, whereas the
* nextMessage method will return only when a message is available (or after
* a specific timeout).
@@ -2204,7 +2204,7 @@ public class MultiUserChat {
/**
* Returns the next available message in the chat. The method call will block
- * (not return) until a stanza is available or the timeout has elapased.
+ * (not return) until a stanza is available or the timeout has elapsed.
* If the timeout elapses without a result, null will be returned.
*
* @param timeout the maximum amount of time to wait for the next message.
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
index 9d031a8bd..e8012406f 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java
@@ -298,7 +298,7 @@ public final class MultiUserChatManager extends Manager {
* {@link MultiUserChat#join(org.jxmpp.jid.parts.Resourcepart) join} the chat room. On some server implementations, the room will not be
* created until the first person joins it.
*
- * Most XMPP servers use a sub-domain for the chat service (eg chat.example.com for the XMPP server example.com).
+ * Most XMPP servers use a sub-domain for the chat service (e.g.chat.example.com for the XMPP server example.com).
* You must ensure that the room address you're trying to connect to includes the proper chat sub-domain.
*
*
@@ -481,7 +481,7 @@ public final class MultiUserChatManager extends Manager {
* @throws NoResponseException if there was no response from the remote entity.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
- * @throws NotAMucServiceException if the entity is not a MUC serivce.
+ * @throws NotAMucServiceException if the entity is not a MUC service.
* @since 4.3.1
*/
public Map getRoomsHostedBy(DomainBareJid serviceName) throws NoResponseException, XMPPErrorException,
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java
index 8a376ca36..58454d6e9 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusListener.java
@@ -129,7 +129,7 @@ public interface ParticipantStatusListener {
/**
* Called when an administrator grants moderator privileges to a user. This means that the user
* will be able to kick users, grant and revoke voice, invite other users, modify room's
- * subject plus all the partcipants privileges.
+ * subject plus all the participant privileges.
*
* @param participant the participant that was granted moderator privileges in the room
* (e.g. room@conference.jabber.org/nick).
@@ -140,7 +140,7 @@ public interface ParticipantStatusListener {
/**
* Called when an administrator revokes moderator privileges from a user. This means that the
* user will no longer be able to kick users, grant and revoke voice, invite other users,
- * modify room's subject plus all the partcipants privileges.
+ * modify room's subject plus all the participant privileges.
*
* @param participant the participant that was revoked moderator privileges in the room
* (e.g. room@conference.jabber.org/nick).
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java
index d321903dd..b43e33ae9 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/RoomInfo.java
@@ -77,7 +77,7 @@ public class RoomInfo {
*/
private final boolean moderated;
/**
- * Every presence stanza can include the JID of every occupant unless the owner deactives this
+ * Every presence stanza can include the JID of every occupant unless the owner deactivates this
* configuration.
*/
private final boolean nonanonymous;
@@ -250,7 +250,7 @@ public class RoomInfo {
/**
* Returns the room name.
*
- * The name returnd here was provided as value of the name attribute
+ * The name returned here was provided as value of the name attribute
* of the returned identity within the disco#info result.
*
*
@@ -324,9 +324,9 @@ public class RoomInfo {
}
/**
- * Returns true if users musy provide a valid password in order to join the room.
+ * Returns true if users must provide a valid password in order to join the room.
*
- * @return true if users musy provide a valid password in order to join the room.
+ * @return true if users must provide a valid password in order to join the room.
*/
public boolean isPasswordProtected() {
return passwordProtected;
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/UserStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/UserStatusListener.java
index b8d9db944..93cf585fe 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/UserStatusListener.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/UserStatusListener.java
@@ -39,7 +39,7 @@ public interface UserStatusListener {
/**
* Called when a moderator kicked your user from the room. This means that you are no longer
- * participanting in the room.
+ * participating in the room.
*
* @param actor the moderator that kicked your user from the room (e.g. user@host.org).
* @param reason the reason provided by the actor to kick you from the room.
@@ -106,7 +106,7 @@ public interface UserStatusListener {
/**
* Called when an administrator grants moderator privileges to your user. This means that you
* will be able to kick users, grant and revoke voice, invite other users, modify room's
- * subject plus all the partcipants privileges.
+ * subject plus all the participant privileges.
*
*/
default void moderatorGranted() {
@@ -115,7 +115,7 @@ public interface UserStatusListener {
/**
* Called when an administrator revokes moderator privileges from your user. This means that
* you will no longer be able to kick users, grant and revoke voice, invite other users,
- * modify room's subject plus all the partcipants privileges.
+ * modify room's subject plus all the participant privileges.
*
*/
default void moderatorRevoked() {
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/package-info.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/package-info.java
index 5adaa5a6f..78866dd6a 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/package-info.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/package-info.java
@@ -534,7 +534,7 @@
*
*
Usage
*
- * In order to grant membership to a room, administrator privileges or owner priveliges just send
+ * In order to grant membership to a room, administrator privileges or owner privileges just send
* **grantMembership(String jid)**, **grantAdmin(String jid)** or **grantOwnership(String jid)** to _**MultiUserChat**_
* respectively. Use **revokeMembership(String jid)**, **revokeAdmin(String jid)** or revokeOwnership(String jid)** to
* revoke the membership to a room, administrator privileges or owner priveliges respectively.
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/nick/packet/Nick.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/nick/packet/Nick.java
index bc1bd04b4..3ea4d3e1d 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/nick/packet/Nick.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/nick/packet/Nick.java
@@ -35,7 +35,7 @@ public class Nick implements ExtensionElement {
public static final QName QNAME = new QName(NAMESPACE, "nick");
/**
- * Deprected, do not use.
+ * Deprecated, do not use.
*
* @deprecated use {@link #QNAME} instead.
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PepManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PepManager.java
index 404da53fb..7eaad0db4 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PepManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pep/PepManager.java
@@ -288,7 +288,7 @@ public final class PepManager extends Manager {
*/
public LeafNode publish(String nodeId, Item item) throws NotConnectedException, InterruptedException,
NoResponseException, XMPPErrorException, NotALeafNodeException {
- // PEP nodes are auto created if not existent. Hence Use PubSubManager.tryToPublishAndPossibleAutoCreate() here.
+ // PEP nodes are auto created if not existent. Hence, use PubSubManager.tryToPublishAndPossibleAutoCreate() here.
return pepPubSubManager.tryToPublishAndPossibleAutoCreate(nodeId, item);
}
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java
index b7b0f1dcd..fc39376b3 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java
@@ -150,11 +150,11 @@ public final class PingManager extends Manager {
// We may received an error response from an intermediate service returning an error like
// 'remote-server-not-found' or 'remote-server-timeout' to us (which would fake the 'from' address,
- // see RFC 6120 § 8.3.1 2.). Or the recipient could became unavailable.
+ // see RFC 6120 § 8.3.1 2.). Or the recipient could become unavailable.
// Sticking with the current rules of RFC 6120/6121, it is undecidable at this point whether we received an
// error response from the pinged entity or not. This is because a service-unavailable error condition is
- // *required* (as per the RFCs) to be send back in both relevant cases:
+ // *required* (as per the RFCs) to be sent back in both relevant cases:
// 1. When the receiving entity is unaware of the IQ request type. RFC 6120 § 8.4.:
// "If an intended recipient receives an IQ stanza of type "get" or
// "set" containing a child element qualified by a namespace it does
@@ -244,7 +244,7 @@ public final class PingManager extends Manager {
}
/**
- * Same as calling {@link #ping(Jid, long)} with the defaultpacket reply
+ * Same as calling {@link #ping(Jid, long)} with the default packet reply
* timeout.
*
* @param jid The id of the entity the ping is being sent to
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/package-info.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/package-info.java
index 38a4c93c3..bfdc39d03 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/package-info.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/package-info.java
@@ -156,7 +156,7 @@
*
* In order to handle privacy changes, clients SHOULD listen manager’s updates. When a list is changed the manager
* notifies every added listener. Listeners MUST implement the PrivacyListListener interface. Clients may
- * need to react when a privacy list is modified. The PrivacyListManager lets you add listerners that will
+ * need to react when a privacy list is modified. The PrivacyListManager lets you add listeners that will
* be notified when a list has been changed. Listeners should implement the PrivacyListListener interface.
*
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/packet/PrivacyItem.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/packet/PrivacyItem.java
index c977fdaf3..a80276e5b 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/packet/PrivacyItem.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/packet/PrivacyItem.java
@@ -171,7 +171,7 @@ public class PrivacyItem {
}
/**
- * Sets wheather the receiver allows or denies incoming messages or not.
+ * Sets whether the receiver allows or denies incoming messages or not.
*
* @param filterMessage indicates if the receiver allows or denies incoming messages or not.
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
index cbe9c10cb..6744c5713 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
@@ -263,7 +263,7 @@ public final class PubSubManager extends Manager {
DataForm submitForm = config.getDataFormToSubmit();
request.addExtension(new FormNode(FormNodeType.CONFIGURE, submitForm));
NodeType nodeType = config.getNodeType();
- // Note that some implementations do to have the pubsub#node_type field in their defauilt configuration,
+ // Note that some implementations do to have the pubsub#node_type field in their default configuration,
// which I believe to be a bug. However, since PubSub specifies the default node type to be 'leaf' we assume
// leaf if the field does not exist.
isLeafNode = nodeType == null || nodeType == NodeType.leaf;
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/SimplePayload.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/SimplePayload.java
index 200be7f4b..730c4c4c8 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/SimplePayload.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/SimplePayload.java
@@ -66,7 +66,7 @@ public class SimplePayload implements XmlElement {
* @param elementName The root element name (of the payload)
* @param namespace The namespace of the payload, null if there is none
* @param xmlPayload The payload data
- * @deprecated use {@link #SimplePayload(String)} insteas.
+ * @deprecated use {@link #SimplePayload(String)} instead.
*/
// TODO: Remove in Smack 4.5
@Deprecated
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/search/ReportedData.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/search/ReportedData.java
index 36853164b..ac2cec39d 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/search/ReportedData.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/search/ReportedData.java
@@ -150,7 +150,7 @@ public class ReportedData {
/**
* Creates a new column with the specified definition.
*
- * @param label the columns's label.
+ * @param label the column's label.
* @param variable the variable name of the column.
* @param type the format for the returned data.
*/
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java
index 4f4d74a19..4d6f18ecf 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java
@@ -122,7 +122,7 @@ public final class VCard extends IQ {
private String photoBinval;
/**
- * Such as DESC ROLE GEO etc.. see XEP-0054
+ * Such as DESC ROLE GEO etc. see XEP-0054
*/
private final Map otherSimpleFields = new HashMap<>();
@@ -575,7 +575,7 @@ public final class VCard extends IQ {
* Load VCard information for a given user. XMPPConnection should be authenticated and not anonymous.
*
* @param connection connection.
- * @param user user whos information we want to load.
+ * @param user user whose information we want to load.
*
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the server.
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/BooleanFormField.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/BooleanFormField.java
index 6681e6408..756c14b52 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/BooleanFormField.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/BooleanFormField.java
@@ -36,7 +36,7 @@ public class BooleanFormField extends SingleValueFormField {
}
/**
- * Get the value of the booelan field. Note that, if no explicit boolean value is provided, in the form of "true",
+ * Get the value of the boolean field. Note that, if no explicit boolean value is provided, in the form of "true",
* "false", "0", or "1", then the default value of a boolean field is false, according to
* XEP-0004 § 3.3.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/package-info.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/package-info.java
index 7054e0f22..7ebb8cee9 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/package-info.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/package-info.java
@@ -152,7 +152,7 @@
* Before you start to send XHTML messages to a user you should discover if the user supports XHTML messages. There are
* two ways to achieve the discovery, explicitly and implicitly. Explicit is when you first try to discover if the user
* supports XHTML before sending any XHTML message. Implicit is when you send XHTML messages without first discovering
- * if the conversation partner's client supports XHTML and depenging on the answer (normal message or XHTML message) you
+ * if the conversation partner's client supports XHTML and depending on the answer (normal message or XHTML message) you
* find out if the user supports XHTML messages or not. This section explains how to explicitly discover for XHTML
* support.
*
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java b/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java
index c57bc5e34..a00871964 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java
@@ -79,7 +79,7 @@ public class Chat {
/**
* Returns the name of the user the chat is with.
*
- * @return the name of the user the chat is occuring with.
+ * @return the name of the user the chat is occurring with.
*/
public EntityJid getParticipant() {
return participant;
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
index c640edfdc..4b38ef567 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
@@ -118,8 +118,8 @@ import org.jxmpp.util.cache.LruCache;
* Every entry in the roster has presence associated with it. The
* {@link #getPresence(BareJid)} method will return a Presence object with the
* user's presence or `null` if the user is not online or you are not subscribed
- * to the user's presence. _Note:_ Presence subscription is nnot tied to the
- * user being on the roster, and vice versa: You could be subscriped to a remote
+ * to the user's presence. _Note:_ Presence subscription is not tied to the
+ * user being on the roster, and vice versa: You could be subscribed to a remote
* users presence without the user in your roster, and a remote user can be in
* your roster without any presence subscription relation.
*
@@ -242,13 +242,13 @@ public final class Roster extends Manager {
private static boolean rosterLoadedAtLoginDefault = true;
/**
- * The default subscription processing mode to use when a Roster is created. By default
+ * The default subscription processing mode to use when a Roster is created. By default,
* all subscription requests are automatically rejected.
*/
private static SubscriptionMode defaultSubscriptionMode = SubscriptionMode.reject_all;
/**
- * The initial maximum size of the map holding presence information of entities without an Roster entry. Currently
+ * The initial maximum size of the map holding presence information of entities without a Roster entry. Currently
* {@value #INITIAL_DEFAULT_NON_ROSTER_PRESENCE_MAP_SIZE}.
*/
public static final int INITIAL_DEFAULT_NON_ROSTER_PRESENCE_MAP_SIZE = 1024;
@@ -285,7 +285,7 @@ public final class Roster extends Manager {
private final Map> presenceMap = new ConcurrentHashMap<>();
/**
- * Like {@link presenceMap} but for presences of entities not in our Roster.
+ * Like {@link #presenceMap} but for presences of entities not in our Roster.
*/
// TODO Ideally we want here to use a LRU cache like Map which will evict all superfluous items
// if their maximum size is lowered below the current item count. LruCache does not provide
@@ -299,7 +299,7 @@ public final class Roster extends Manager {
private final Set rosterLoadedListeners = new LinkedHashSet<>();
/**
- * Mutually exclude roster listener invocation and changing the {@link entries} map. Also used
+ * Mutually exclude roster listener invocation and changing the {@link #entries} map. Also used
* to synchronize access to either the roster listeners or the entries map.
*/
private final Object rosterListenersAndEntriesLock = new Object();
@@ -439,7 +439,7 @@ public final class Roster extends Manager {
return;
}
- // Ensure that all available presences received so far in a eventually existing previous session are
+ // Ensure that all available presences received so far in an eventually existing previous session are
// marked 'offline'.
setOfflinePresencesAndResetLoaded();
@@ -760,7 +760,7 @@ public final class Roster extends Manager {
*
* @param user the user. (e.g. johndoe@jabber.org)
* @param name the nickname of the user.
- * @param groups the list of group names the entry will belong to, or null if the
+ * @param groups the list of group names the entry will belong to, or null if
* the roster entry won't belong to a group.
* @throws NoResponseException if there was no response from the server.
* @throws XMPPErrorException if an XMPP exception occurs.
@@ -818,7 +818,7 @@ public final class Roster extends Manager {
*
* @param jid the XMPP address of the contact (e.g. johndoe@jabber.org)
* @param name the nickname of the user.
- * @param groups the list of group names the entry will belong to, or null if the
+ * @param groups the list of group names the entry will belong to, or null if
* the roster entry won't belong to a group.
* @throws NoResponseException if there was no response from the server.
* @throws XMPPErrorException if an XMPP exception occurs.
@@ -839,7 +839,7 @@ public final class Roster extends Manager {
*
* @param user the user. (e.g. johndoe@jabber.org)
* @param name the nickname of the user.
- * @param groups the list of group names the entry will belong to, or null if the
+ * @param groups the list of group names the entry will belong to, or null if
* the roster entry won't belong to a group.
* @throws NoResponseException if there was no response from the server.
* @throws XMPPErrorException if an XMPP exception occurs.
@@ -1042,7 +1042,7 @@ public final class Roster extends Manager {
* Returns the roster entry associated with the given XMPP address or
* null if the user is not an entry in the roster.
*
- * @param jid the XMPP address of the user (eg "jsmith@example.com"). The address could be
+ * @param jid the XMPP address of the user (e.g."jsmith@example.com"). The address could be
* in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").
* @return the roster entry or null if it does not exist.
*/
@@ -1056,7 +1056,7 @@ public final class Roster extends Manager {
/**
* Returns true if the specified XMPP address is an entry in the roster.
*
- * @param jid the XMPP address of the user (eg "jsmith@example.com"). The
+ * @param jid the XMPP address of the user (e.g."jsmith@example.com"). The
* address must be a bare JID e.g. "domain/resource" or
* "user@domain".
* @return true if the XMPP address is an entry in the roster.
@@ -1118,11 +1118,11 @@ public final class Roster extends Manager {
* {@link RosterListener}.
*
*
- * @param jid the XMPP address of the user (eg "jsmith@example.com"). The
+ * @param jid the XMPP address of the user (e.g."jsmith@example.com"). The
* address must be a bare JID e.g. "domain/resource" or
* "user@domain".
* @return the user's current presence, or unavailable presence if the user is offline
- * or if no presence information is available..
+ * or if no presence information is available.
*/
public Presence getPresence(BareJid jid) {
Map userPresences = getPresencesInternal(jid);
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java
index 8a13fda90..0360f892b 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterEntry.java
@@ -108,7 +108,7 @@ public final class RosterEntry extends Manager {
packet.setType(IQ.Type.set);
// Create a new roster item with the current RosterEntry and the *new* name. Note that we can't set the name of
- // RosterEntry right away, as otherwise the updated event wont get fired, because equalsDeep would return true.
+ // RosterEntry right away, as otherwise the updated event won't get fired, because equalsDeep would return true.
packet.addRosterItem(toRosterItem(this, name));
connection().sendIqRequestAndWaitForResponse(packet);
@@ -136,7 +136,7 @@ public final class RosterEntry extends Manager {
}
/**
- * Returns an copied list of the roster groups that this entry belongs to.
+ * Returns a copied list of the roster groups that this entry belongs to.
*
* @return an iterator for the groups this entry belongs to.
*/
@@ -306,7 +306,7 @@ public final class RosterEntry extends Manager {
*
* @param entry the roster entry.
* @param name the name of the roster item.
- * @param includeAskAttribute whether or not to include the 'ask' attribute.
+ * @param includeAskAttribute whether to include the 'ask' attribute.
* @return the roster item.
*/
private static RosterPacket.Item toRosterItem(RosterEntry entry, String name, boolean includeAskAttribute) {
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterGroup.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterGroup.java
index f8718fcbb..d6467dd83 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterGroup.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/RosterGroup.java
@@ -116,7 +116,7 @@ public class RosterGroup extends Manager {
* Returns the roster entry associated with the given XMPP address or
* null if the user is not an entry in the group.
*
- * @param user the XMPP address of the user (eg "jsmith@example.com").
+ * @param user the XMPP address of the user (e.g."jsmith@example.com").
* @return the roster entry or null if it does not exist in the group.
*/
public RosterEntry getEntry(Jid user) {
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java
index 8afe9f9e4..a0f658977 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java
@@ -100,8 +100,8 @@ public class XmppConnectionStressTest {
for (int c = 0; c < payloadChunkCount; c++) {
int payloadChunkSize = random.nextInt(configuration.maxPayloadChunkSize) + 1;
- String payloadCunk = StringUtils.randomString(payloadChunkSize, random);
- JivePropertiesManager.addProperty(messageBuilder, "payload-chunk-" + c, payloadCunk);
+ String payloadChunk = StringUtils.randomString(payloadChunkSize, random);
+ JivePropertiesManager.addProperty(messageBuilder, "payload-chunk-" + c, payloadChunk);
}
JivePropertiesManager.addProperty(messageBuilder, MESSAGE_NUMBER_PROPERTY, i);
@@ -184,7 +184,7 @@ public class XmppConnectionStressTest {
Exception exception = new Exception(exceptionMessage.toString());
receiveExceptions.put(connection, exception);
// TODO: Current Smack design does not guarantee that the listener won't be invoked again.
- // This is because the decission to invoke a sync listeners is done at a different place
+ // This is because the decision to invoke a sync listeners is done at a different place
// then invoking the listener.
connection.removeSyncStanzaListener(this);
receivedSemaphore.release();
@@ -338,7 +338,7 @@ public class XmppConnectionStressTest {
sb.append("Exceptions while sending and/or receiving.");
if (!sendExceptions.isEmpty()) {
- sb.append(" Send exxceptions: ");
+ sb.append(" Send exceptions: ");
for (Map.Entry entry : sendExceptions.entrySet()) {
sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(';');
}
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index 070974a67..dd0f7fcac 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -432,7 +432,7 @@ public class SmackIntegrationTestFramework {
final Class>[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length > 0) {
throw new IllegalStateException(
- "SmackIntegrationTest annotaton on " + method + " that takes arguments ");
+ "SmackIntegrationTest annotation on " + method + " that takes arguments ");
}
break;
case LowLevel:
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionDescriptor.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionDescriptor.java
index 173407429..adcdcaa40 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionDescriptor.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionDescriptor.java
@@ -155,7 +155,7 @@ public final class XmppConnectionDescriptor<
return XmppConnectionDescriptor.buildWith(ModularXmppClientToServerConnection.class, ModularXmppClientToServerConnectionConfiguration.class, ModularXmppClientToServerConnectionConfiguration.Builder.class)
.withNickname(nickname)
- .applyExtraConfguration(cb -> {
+ .applyExtraConfiguration(cb -> {
cb.removeAllModules();
ModularXmppClientToServerConnectionModuleDescriptor webSocketModuleDescriptor =
XmppWebSocketTransportModuleDescriptor.getBuilder(cb)
@@ -184,7 +184,13 @@ public final class XmppConnectionDescriptor<
nickname = connectionClass.getSimpleName();
}
+ // TODO Remove in Smack 4.6
+ @Deprecated // Replaced by applyExtraConfiguration(Consumer extraBuilder)
public Builder applyExtraConfguration(Consumer extraBuilder) {
+ return applyExtraConfiguration(extraBuilder);
+ }
+
+ public Builder applyExtraConfiguration(Consumer extraBuilder) {
this.extraBuilder = extraBuilder;
return this;
}
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java
index 0653e5d14..3b2f21b60 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java
@@ -85,7 +85,7 @@ public class XmppConnectionManager {
addConnectionDescriptor(
XmppConnectionDescriptor.buildWith(ModularXmppClientToServerConnection.class, ModularXmppClientToServerConnectionConfiguration.class, ModularXmppClientToServerConnectionConfiguration.Builder.class)
.withNickname("modular-nocompress")
- .applyExtraConfguration(cb -> cb.removeModule(CompressionModuleDescriptor.class))
+ .applyExtraConfiguration(cb -> cb.removeModule(CompressionModuleDescriptor.class))
.build()
);
addConnectionDescriptor(
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
index 22ad207f5..84301a2f5 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/package-info.java
@@ -145,7 +145,7 @@
*
*
*
disabledSpecifications
- *
List of specificatinos for which to disable tests
+ *
List of specifications for which to disable tests
*
*
*
defaultConnection
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java
index 63704c2c2..1e75154a9 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/LoginIntegrationTest.java
@@ -48,7 +48,7 @@ public class LoginIntegrationTest extends AbstractSmackLowLevelIntegrationTest {
* @throws IOException if an I/O error occurred.
* @throws SmackException if Smack detected an exceptional situation.
* @throws NoSuchAlgorithmException if no such algorithm is available.
- * @throws KeyManagementException if there was a key mangement error.
+ * @throws KeyManagementException if there was a key management error.
*/
@SmackIntegrationTest
public void testInvalidLogin(UnconnectedConnectionSource unconnectedConnectionSource) throws SmackException, IOException, XMPPException,
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java
index 045f06691..9f150bd7a 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java
@@ -61,7 +61,7 @@ public class LowLevelRosterIntegrationTest extends AbstractSmackLowLevelIntegrat
rosterOne.addPresenceEventListener(presenceEventListener);
try {
- // Disconnect conTwo, this should cause an 'unavailable' presence to be send from conTwo to
+ // Disconnect conTwo, this should cause an 'unavailable' presence to be sent from conTwo to
// conOne.
conTwo.disconnect();
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java
index b13b4df6e..9465ef14a 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java
@@ -185,7 +185,7 @@ public abstract class AbstractMultiUserChatIntegrationTest extends AbstractSmack
*
From XEP-0045 § 10.1.3:
*
* Note: The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"),
- * semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here).
+ * semi-anonymous (a value of "moderators"), or fully anonymous (a value of "none", not shown here).
*
* Note: The _whois configuration option specifies whether the room is non-anonymous (a value of "anyone"),
- * semi-anonymous (a value of "moderators"), or fully anonmyous (a value of "none", not shown here).
+ * semi-anonymous (a value of "moderators"), or fully anonymous (a value of "none", not shown here).
*
*/
static void createSemiAnonymousMuc(MultiUserChat muc, Resourcepart resourceName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, InterruptedException, MultiUserChatException.MucAlreadyJoinedException, SmackException.NotConnectedException, MultiUserChatException.MissingMucCreationAcknowledgeException, MultiUserChatException.NotAMucServiceException {
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 9c88f47fe..56c8a6dbb 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
@@ -219,7 +219,7 @@ public class MultiUserChatRolesAffiliationsPrivilegesIntegrationTest extends Abs
}
/**
- * Asserts that a user in an unmoderated room who undergoes an afilliation change receives that change as a presence update.
+ * Asserts that a user in an unmoderated room who undergoes an affiliation change receives that change as a presence update.
*
* @throws Exception when errors occur
*/
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
index 1b9954a03..d3f990a4a 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java
@@ -113,7 +113,7 @@ public class PubSubIntegrationTest extends AbstractSmackIntegrationTest {
// Add a dummy payload. If there is no payload, but just an item ID, then ejabberd will *not* return an error,
// which I believe to be non-compliant behavior (although, granted, the XEP is not very clear about this). A user
// which sends an empty item with ID to an node that is configured to be notification-only and transient probably
- // does something wrong, as the item's ID will never appear anywhere. Hence it would be nice if the user would be
+ // does something wrong, as the item's ID will never appear anywhere. Hence, it would be nice if the user would be
// made aware of this issue by returning an error. Sadly ejabberd does not do so.
// See also https://github.com/processone/ejabberd/issues/2864#issuecomment-500741915
final StandardExtensionElement dummyPayload = StandardExtensionElement.builder("dummy-payload",
diff --git a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestXmppConnectionManagerTest.java b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestXmppConnectionManagerTest.java
index 7a2de6097..d8aa16015 100644
--- a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestXmppConnectionManagerTest.java
+++ b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestXmppConnectionManagerTest.java
@@ -43,7 +43,7 @@ public class SmackIntegrationTestXmppConnectionManagerTest {
ModularXmppClientToServerConnection.class,
ModularXmppClientToServerConnectionConfiguration.class,
ModularXmppClientToServerConnectionConfiguration.Builder.class)
- .applyExtraConfguration(b -> b.removeAllModules().addModule(XmppTcpTransportModuleDescriptor.class))
+ .applyExtraConfiguration(b -> b.removeAllModules().addModule(XmppTcpTransportModuleDescriptor.class))
.build();
Configuration sinttestConfiguration = Configuration.builder().setService("example.org").build();
diff --git a/smack-java8-full/src/main/java/org/jivesoftware/smackx/SmackExtensions.java b/smack-java8-full/src/main/java/org/jivesoftware/smackx/SmackExtensions.java
index 8ec3ad057..186562bba 100644
--- a/smack-java8-full/src/main/java/org/jivesoftware/smackx/SmackExtensions.java
+++ b/smack-java8-full/src/main/java/org/jivesoftware/smackx/SmackExtensions.java
@@ -18,7 +18,7 @@ package org.jivesoftware.smackx;
/**
* This is just a dummy class, please head over to {@link org.jivesoftware.smackx} for more information on Smack
- * extensions. The dummy class causes javadoc generate the HTML for smackx.pacakge-info.java, which would otherwise be
+ * extensions. The dummy class causes javadoc generate the HTML for smackx.package-info.java, which would otherwise be
* not generated, as org.jivesoftware.smackx is an empty package (see
* JDK-4492654).
*/
diff --git a/smack-java8-full/src/main/java/org/jivesoftware/smackx/package-info.java b/smack-java8-full/src/main/java/org/jivesoftware/smackx/package-info.java
index f499a6996..0769f65ba 100644
--- a/smack-java8-full/src/main/java/org/jivesoftware/smackx/package-info.java
+++ b/smack-java8-full/src/main/java/org/jivesoftware/smackx/package-info.java
@@ -71,7 +71,7 @@
*
Allows to include XEP-0080 gelocation data in XEP-0004 data forms.
+ *
Allows to include XEP-0080 geolocation data in XEP-0004 data forms.
*
*
*
Client State Indication
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java
index acd9a5796..f4ad1c0a8 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleManager.java
@@ -540,7 +540,7 @@ public class JingleManager implements JingleSessionListener {
// }
/**
* When the session request is acceptable, this method should be invoked. It
- * will create an JingleSession which allows the negotiation to procede.
+ * will create an JingleSession which allows the negotiation to proceed.
*
* @param request the remote request that is being accepted.
* @return the session which manages the rest of the negotiation.
@@ -560,7 +560,7 @@ public class JingleManager implements JingleSessionListener {
/**
* When the session request is acceptable, this method should be invoked. It
- * will create an JingleSession which allows the negotiation to procede.
+ * will create an JingleSession which allows the negotiation to proceed.
* This method use JingleMediaManager to select the supported Payload types.
*
* @param request the remote request that is being accepted.
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleNegotiator.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleNegotiator.java
index 656faad25..d944679b8 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleNegotiator.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleNegotiator.java
@@ -221,7 +221,7 @@ public abstract class JingleNegotiator {
* <transport>
*
* This way, each segment of a Jingle stanza has a corresponding negotiator that know how to deal with that
- * part of the Jingle packet. It also allows us to support Jingle packets of arbitraty complexity.
+ * part of the Jingle packet. It also allows us to support Jingle packets of arbitrary complexity.
*
* Each parent calls dispatchIncomingPacket for each of its children. The children then pass back a List of
* results that will get sent when we reach the top level negotiator (JingleSession).
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
index dabc962b0..cb141e837 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
@@ -431,7 +431,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Complete and send a packet. Complete all the null fields in a Jingle
- * reponse, using the session information we have.
+ * response, using the session information we have.
*
* @param jout
* the Jingle stanza we want to complete and send
@@ -445,7 +445,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
/**
* Complete and send a packet. Complete all the null fields in a Jingle
- * reponse, using the session information we have or some info from the
+ * response, using the session information we have or some info from the
* incoming packet.
*
* @param iq The Jingle stanza we are responding to
@@ -1097,7 +1097,7 @@ public final class JingleSession extends JingleNegotiator implements MediaReceiv
}
/**
- * This is the starting point for intitiating a new session.
+ * This is the starting point for initiating a new session.
*
* @throws IllegalStateException if an illegal state was encountered
* @throws SmackException if Smack detected an exceptional situation.
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSessionState.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSessionState.java
index a1bc7263b..5a1f7660a 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSessionState.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSessionState.java
@@ -56,7 +56,7 @@ public abstract class JingleSessionState {
/**
* Process an incoming Jingle Packet.
- * When you look at the GoF State pattern this method roughly corresponds to example on p310: ProcessOctect()
+ * When you look at the GoF State pattern this method roughly corresponds to example on p310: ProcessOctet()
*
* @param session the jingle session.
* @param jingle the jingle stanza.
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/CreatedJingleSessionListener.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/CreatedJingleSessionListener.java
index 294e321cd..dda67f72e 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/CreatedJingleSessionListener.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/CreatedJingleSessionListener.java
@@ -19,7 +19,7 @@ package org.jivesoftware.smackx.jingleold.listeners;
import org.jivesoftware.smackx.jingleold.JingleSession;
/**
- * Inteface used to dispatch a event when a Jingle session is created.
+ * Interface used to dispatch an event when a Jingle session is created.
*
* @author Thiago Camargo
*/
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java
index fb754e489..768cc42c9 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java
@@ -33,7 +33,7 @@ public interface JingleSessionListener extends JingleListener {
* Notification that the session has been established. Arguments specify
* the payload type and transport to use.
*
- * @param pt the Payload tyep to use
+ * @param pt the Payload type to use
* @param remoteCandidate the remote candidate to use for connecting to the remote
* service.
* @param localCandidate the local candidate where we must listen for connections
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/JingleMediaSession.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/JingleMediaSession.java
index 2956a265a..7df3c2f06 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/JingleMediaSession.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/JingleMediaSession.java
@@ -25,7 +25,7 @@ import org.jivesoftware.smackx.jingleold.nat.TransportCandidate;
/**
* Public Abstract Class provides a clear interface between Media Session and Jingle API.
*
- * When a Jingle Session is fully stablished, we will have a Payload Type and two transport candidates defined for it.
+ * When a Jingle Session is fully established, we will have a Payload Type and two transport candidates defined for it.
* Smack Jingle API don't implement Media Transmit and Receive methods.
* But provides an interface to let the user implements it using another API. For instance: JMF.
*
@@ -153,7 +153,7 @@ public abstract class JingleMediaSession {
public abstract void startReceive();
/**
- * Set transmit activity. If the active is true, the instance should trasmit.
+ * Set transmit activity. If the active is true, the instance should transmit.
* If it is set to false, the instance should pause transmit.
*
* @param active TODO javadoc me please
@@ -173,7 +173,7 @@ public abstract class JingleMediaSession {
/**
* Called when new Media is received.
*
- * @param participant the particpant.
+ * @param participant the participant.
*/
public void mediaReceived(String participant) {
for (MediaReceivedListener mediaReceivedListener : mediaReceivedListeners) {
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/PayloadType.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/PayloadType.java
index c7dd7b8e0..08675d8b4 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/PayloadType.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/PayloadType.java
@@ -322,7 +322,7 @@ public class PayloadType {
}
/**
- * Set tha sampling clockRate for a playload type.
+ * Set tha sampling clockRate for a payload type.
*
* @param rate The sampling clockRate
*/
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/AudioChannel.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/AudioChannel.java
index 88cb3a649..61340f80e 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/AudioChannel.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/AudioChannel.java
@@ -322,7 +322,7 @@ public class AudioChannel {
String encoding = codecFormat.getEncoding();
if (encoding.equalsIgnoreCase(AudioFormat.GSM) ||
encoding.equalsIgnoreCase(AudioFormat.GSM_RTP)) {
- return milliseconds * 4; // 1 byte per millisec
+ return milliseconds * 4; // 1 byte per millisecond
}
else if (encoding.equalsIgnoreCase(AudioFormat.ULAW) ||
encoding.equalsIgnoreCase(AudioFormat.ULAW_RTP)) {
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jspeex/AudioMediaSession.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jspeex/AudioMediaSession.java
index 555836732..78495aa17 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jspeex/AudioMediaSession.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jspeex/AudioMediaSession.java
@@ -71,7 +71,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
* @throws NoProcessorException if there is no media processor.
* @throws UnsupportedFormatException if the format is not supported.
* @throws IOException if an I/O error occurred.
- * @throws GeneralSecurityException if there was a geneeral security exception.
+ * @throws GeneralSecurityException if there was a general security exception.
*/
public static MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws NoProcessorException, UnsupportedFormatException, IOException, GeneralSecurityException {
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java
index 127a7364c..73bf75e9c 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java
@@ -95,7 +95,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param session The Jingle session
* @param transResolver The JingleTransportManager to use
- * @param parentNegotiator the parent ngeotiator.
+ * @param parentNegotiator the parent negotiator.
*/
public TransportNegotiator(JingleSession session, TransportResolver transResolver, ContentNegotiator parentNegotiator) {
super(session);
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportResolver.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportResolver.java
index 75c1e2f71..b48545292 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportResolver.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportResolver.java
@@ -236,7 +236,7 @@ public abstract class TransportResolver {
}
/**
- * Trigger a event notifying the initialization of the resolution process.
+ * Trigger an event notifying the initialization of the resolution process.
*/
private void triggerResolveInit() {
Iterator iter = getListenersList().iterator();
@@ -250,7 +250,7 @@ public abstract class TransportResolver {
}
/**
- * Trigger a event notifying the obtainment of all the candidates.
+ * Trigger an event notifying the obtainment of all the candidates.
*/
private void triggerResolveEnd() {
Iterator iter = getListenersList().iterator();
diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleTransportProvider.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleTransportProvider.java
index 0edb7d887..b81e4f201 100644
--- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleTransportProvider.java
+++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleTransportProvider.java
@@ -88,7 +88,7 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider listeners = new ArrayList<>();
private final Map> presenceMap = new HashMap<>();
// The roster is marked as initialized when at least a single roster packet
- // has been recieved and processed.
+ // has been received and processed.
boolean rosterInitialized = false;
/**
@@ -181,7 +181,7 @@ public class AgentRoster {
/**
* Returns true if the specified XMPP address is an agent in the workgroup.
*
- * @param jid the XMPP address of the agent (eg "jsmith@example.com"). The
+ * @param jid the XMPP address of the agent (e.g."jsmith@example.com"). The
* address can be in any valid format (e.g. "domain/resource", "user@domain"
* or "user@domain/resource").
* @return true if the XMPP address is an agent in the workgroup.
@@ -208,7 +208,7 @@ public class AgentRoster {
* @param user a fully qualified xmpp JID. The address could be in any valid format (e.g.
* "domain/resource", "user@domain" or "user@domain/resource").
* @return the agent's current presence, or null if the agent is unavailable
- * or if no presence information is available..
+ * or if no presence information is available.
*/
public Presence getPresence(Jid user) {
Jid key = getPresenceMapKey(user);
diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java
index ece31d9c6..3449cd69b 100644
--- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java
+++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/Offer.java
@@ -125,7 +125,7 @@ public class Offer {
}
/**
- * The fully qualified name of the workgroup (eg support@example.com).
+ * The fully qualified name of the workgroup (e.g.support@example.com).
*
* @return the name of the workgroup.
*/
@@ -137,7 +137,7 @@ public class Offer {
* The date when the offer will expire. The agent must {@link #accept()}
* the offer before the expiration date or the offer will lapse and be
* routed to another agent. Alternatively, the agent can {@link #reject()}
- * the offer at any time if they don't wish to accept it..
+ * the offer at any time if they don't wish to accept it.
*
* @return the date at which this offer expires.
*/
diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferListener.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferListener.java
index 93de6bf8f..a33c6797b 100644
--- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferListener.java
+++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/OfferListener.java
@@ -37,7 +37,7 @@ public interface OfferListener {
void offerReceived (Offer request);
/**
- * The implementing class instance will be notified via this when the AgentSessino has received
+ * The implementing class instance will be notified via this when the AgentSession has received
* a revocation of a previously extended offer.
*
* @param revokedOffer the RevokedOffer instance embodying the details of the revoked offer
diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java
index 59ad7c4dc..adb17a07e 100644
--- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java
+++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java
@@ -91,7 +91,7 @@ public class Workgroup {
/**
* Creates a new workgroup instance using the specified workgroup JID
- * (eg support@workgroup.example.com) and XMPP connection. The connection must have
+ * (e.g.support@workgroup.example.com) and XMPP connection. The connection must have
* undergone a successful login before being used to construct an instance of
* this class.
*
@@ -137,7 +137,7 @@ public class Workgroup {
});
/**
- * Internal handling of an invitation.Recieving an invitation removes the user from the queue.
+ * Internal handling of an invitation. Receiving an invitation removes the user from the queue.
*/
MultiUserChatManager.getInstanceFor(connection).addInvitationListener(
new org.jivesoftware.smackx.muc.InvitationListener() {
@@ -162,7 +162,7 @@ public class Workgroup {
}
/**
- * Returns the name of this workgroup (eg support@example.com).
+ * Returns the name of this workgroup (e.g.support@example.com).
*
* @return the name of the workgroup.
*/
@@ -735,9 +735,9 @@ public class Workgroup {
}
/**
- * Asks the workgroup for it's Properties.
+ * Asks the workgroup for its Properties.
*
- * @param jid the jid of the user who's information you would like the workgroup to retreive.
+ * @param jid the jid of the user whose information you would like the workgroup to retrieve.
* @return the WorkgroupProperties for the specified workgroup.
* @throws XMPPErrorException if there was an XMPP error returned.
* @throws NoResponseException if there was no response from the remote entity.
diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java
index baac6db8c..25461a3cd 100644
--- a/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java
+++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java
@@ -42,7 +42,7 @@ import org.jxmpp.jid.Jid;
/**
*
- * Manages Roster exchanges. A RosterExchangeManager provides a high level access to send
+ * Manages Roster exchanges. A RosterExchangeManager provides high level access to send
* rosters, roster groups and roster entries to XMPP clients. It also provides an easy way
* to hook up custom logic when entries are received from another XMPP client through
* RosterExchangeListeners.
@@ -106,7 +106,7 @@ public class RosterExchangeManager {
* Removes a listener from roster exchanges. The listener will be fired anytime roster
* entries are received from remote XMPP clients.
*
- * @param rosterExchangeListener a roster exchange listener..
+ * @param rosterExchangeListener a roster exchange listener.
*/
public void removeRosterListener(RosterExchangeListener rosterExchangeListener) {
rosterExchangeListeners.remove(rosterExchangeListener);
diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java
index 82266bf2a..d8e768e01 100644
--- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java
+++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java
@@ -893,7 +893,7 @@ public abstract class OmemoService
*
* The `setup()` method registers the service as a singleton. You can later access the instance by calling
- * `SignalOmemoService.getInstace()`. The service can only be registered once. Subsequent calls will throw an
+ * `SignalOmemoService.getInstance()`. The service can only be registered once. Subsequent calls will throw an
* {@link IllegalStateException}.
*
*
2. Set an OmemoStore
diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java
index 0810fe1d1..5144b4f02 100644
--- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java
+++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java
@@ -83,7 +83,7 @@ public class OmemoMessageBuilderEjabberd bug tracker about the issue
diff --git a/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java b/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java
index ea508f0fe..9e78b34b8 100644
--- a/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java
+++ b/smack-resolver-javax/src/main/java/org/jivesoftware/smack/util/dns/javax/JavaxResolver.java
@@ -40,7 +40,7 @@ import org.minidns.record.SRV;
/**
* A DNS resolver (mostly for SRV records), which makes use of the API provided in the javax.* namespace.
- * Note that using JavaxResovler requires applications using newer Java versions (at least 11) to declare a dependency on the "sun.jdk" module.
+ * Note that using JavaxResolver requires applications using newer Java versions (at least 11) to declare a dependency on the "sun.jdk" module.
*
* @author Florian Schmaus
*
diff --git a/smack-sasl-javax/src/main/java/org/jivesoftware/smack/sasl/javax/SASLExternalMechanism.java b/smack-sasl-javax/src/main/java/org/jivesoftware/smack/sasl/javax/SASLExternalMechanism.java
index f0c409c49..fdc7822a8 100644
--- a/smack-sasl-javax/src/main/java/org/jivesoftware/smack/sasl/javax/SASLExternalMechanism.java
+++ b/smack-sasl-javax/src/main/java/org/jivesoftware/smack/sasl/javax/SASLExternalMechanism.java
@@ -24,7 +24,7 @@ package org.jivesoftware.smack.sasl.javax;
* to the implementer to determine how to do this. Here is one method:
*
* Create a java keystore with your SSL certificate in it:
- * keytool -genkey -alias username -dname "cn=username,ou=organizationalUnit,o=organizationaName,l=locality,s=state,c=country"
+ * keytool -genkey -alias username -dname "cn=username,ou=organizationalUnit,o=organizationalName,l=locality,s=state,c=country"
*
* Next, set the System Properties:
*
@@ -38,7 +38,7 @@ package org.jivesoftware.smack.sasl.javax;
* simply provide the one in the keyStore.
*
* Also worth noting is the EXTERNAL mechanism in Smack is not enabled by default.
- * To enable it, the implementer will need to call SASLAuthentication.supportSASLMechamism("EXTERNAL");
+ * To enable it, the implementer will need to call SASLAuthentication.supportSASLMechanism("EXTERNAL");
*
* @author Jay Kline
*/
diff --git a/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java b/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java
index 2b1a89d0a..284ef767b 100644
--- a/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java
+++ b/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java
@@ -30,7 +30,7 @@ public class SASLDigestMD5Mechanism extends SASLMechanism {
public static final String NAME = DIGESTMD5;
- private static final String INITAL_NONCE = "00000001";
+ private static final String INITIAL_NONCE = "00000001";
/**
* The only 'qop' value supported by this implementation
@@ -159,7 +159,7 @@ public class SASLDigestMD5Mechanism extends SASLMechanism {
+ ",realm=\"" + serviceName + '"'
+ ",nonce=\"" + nonce + '"'
+ ",cnonce=\"" + cnonce + '"'
- + ",nc=" + INITAL_NONCE
+ + ",nc=" + INITIAL_NONCE
+ ",qop=auth"
+ ",digest-uri=\"" + digestUri + '"'
+ ",response=" + responseValue
@@ -218,7 +218,7 @@ public class SASLDigestMD5Mechanism extends SASLMechanism {
kd_argument.append(':');
kd_argument.append(nonce);
kd_argument.append(':');
- kd_argument.append(INITAL_NONCE);
+ kd_argument.append(INITIAL_NONCE);
kd_argument.append(':');
kd_argument.append(cnonce);
kd_argument.append(':');
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/sm/predicates/tcp/package-info.java b/smack-tcp/src/main/java/org/jivesoftware/smack/sm/predicates/tcp/package-info.java
index 15e022848..d6f94b910 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/sm/predicates/tcp/package-info.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/sm/predicates/tcp/package-info.java
@@ -16,6 +16,6 @@
*/
/**
- * XMPPTCPConnection Stream Managment Predicates.
+ * XMPPTCPConnection Stream Management Predicates.
*/
package org.jivesoftware.smack.sm.predicates.tcp;
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
index 38d2d3e55..87ce7c647 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
@@ -187,7 +187,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
private static boolean useSmResumptionDefault = true;
/**
- * The stream ID of the stream that is currently resumable, ie. the stream we hold the state
+ * The stream ID of the stream that is currently resumable, i.e. the stream we hold the state
* for in {@link #clientHandledStanzasCount}, {@link #serverHandledStanzasCount} and
* {@link #unacknowledgedStanzas}.
*/
@@ -203,7 +203,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
private Failed smResumptionFailed;
/**
- * Represents the state of stream magement.
+ * Represents the state of stream management.
*
* This boolean is marked volatile as it is read by various threads, including the reader thread via {@link #isSmEnabled()}.
*
@@ -1162,8 +1162,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
catch (Exception e) {
// Set running to false since this thread will exit here and notifyConnectionError() will wait until
- // the reader and writer thread's 'running' value is false. Hence we need to set it to false before calling
- // notifyConnetctionError() below, even though run() also sets it to false. Therefore, do not remove this.
+ // the reader and writer thread's 'running' value is false. Hence, we need to set it to false before calling
+ // notifyConnectionError() below, even though run() also sets it to false. Therefore, do not remove this.
running = false;
String ignoreReasonThread = null;
@@ -1645,8 +1645,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
private void sendSmAcknowledgementInternal() throws NotConnectedException, InterruptedException {
AckAnswer ackAnswer = new AckAnswer(clientHandledStanzasCount);
// Do net put an ack to the queue if it has already been shutdown. Some servers, like ejabberd, like to request
- // an ack even after we have send a stream close (and hance the queue was shutdown). If we would not check here,
- // then the ack would dangle around in the queue, and be send on the next re-connection attempt even before the
+ // an ack even after we have sent a stream close (and hence the queue was shutdown). If we would not check here,
+ // then the ack would dangle around in the queue, and be sent on the next re-connection attempt even before the
// stream open.
packetWriter.queue.putIfNotShutdown(ackAnswer);
}
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XmppTcpTransportModule.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XmppTcpTransportModule.java
index bd194fcda..2feb626d3 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XmppTcpTransportModule.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XmppTcpTransportModule.java
@@ -373,7 +373,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
}
}
- // It is ok if outpuFilterInputData is 'null' here, this is expected behavior.
+ // It is ok if outputFilterInputData is 'null' here, this is expected behavior.
if (outputFilterInputData != null && outputFilterInputData.hasRemaining()) {
filteredOutgoingBuffer = outputFilterInputData;
} else {
@@ -474,7 +474,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
// read() may return -1 if the input side of a socket is shut down.
// Note that we do not call notifyConnectionError() here because the connection may be
// cleanly shutdown which would also cause read() to return '-1. I assume that this socket
- // will be selected again, on which read() would throw an IOException, which will be catched
+ // will be selected again, on which read() would throw an IOException, which will be caught
// and invoke notifyConnectionError() (see a few lines above).
/*
IOException exception = new IOException("NIO read() returned " + bytesRead);
@@ -633,7 +633,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
@Override
protected void loadConnectionEndpoints(LookupConnectionEndpointsSuccess lookupConnectionEndpointsSuccess) {
// The API contract stats that we will be given the instance we handed out with lookupConnectionEndpoints,
- // which must be of type DiscoveredTcpEndpoints here. Hence if we can not cast it, then there is an internal
+ // which must be of type DiscoveredTcpEndpoints here. Hence, if we can not cast it, then there is an internal
// Smack error.
discoveredTcpEndpoints = (DiscoveredTcpEndpoints) lookupConnectionEndpointsSuccess;
}
@@ -711,7 +711,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
// Add OP_WRITE to the interested Ops, since we have now new things to write. Note that this may cause
// multiple reactor threads to race to the channel selected callback in case we perform this right after
- // a select() returned with this selection key in the selected-key set. Hence we use tryLock() in the
+ // a select() returned with this selection key in the selected-key set. Hence, we use tryLock() in the
// channel selected callback to keep the invariant that only exactly one thread is performing the
// callback.
// Note that we need to perform setInterestedOps() *without* holding the channelSelectedCallbackLock, as
@@ -776,7 +776,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
// TODO: It appears this should be done in a generic way. I'd assume we always
// have to wait for stream features after the connection was established. If this is true then consider
// moving this into State.AbstractTransport. But I am not yet 100% positive that this is the case for every
- // transport. Hence keep it here for now.
+ // transport. Hence, keep it here for now.
connectionInternal.newStreamOpenWaitForFeaturesSequence("stream features after initial connection");
return new TcpSocketConnectedResult(remoteAddress);
@@ -1090,7 +1090,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
// A delegated task is asynchronously running. Take care of the remaining accumulatedData.
addAsPendingInputData(accumulatedData);
// Return here, as the async task created by handleHandshakeStatus will continue calling the
- // cannelSelectedCallback.
+ // channelSelectedCallback.
return null;
case NEED_UNWRAP:
continue;
@@ -1114,7 +1114,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
switch (engineResultStatus) {
case OK:
// SSLEngine's unwrap() may not consume all bytes from the source buffer. If this is the case, then
- // simply perform another unwrap until accumlatedData has no remaining bytes.
+ // simply perform another unwrap until accumulatedData has no remaining bytes.
if (accumulatedData.hasRemaining()) {
continue;
}
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java
index 2b2514dbb..d46344d93 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java
@@ -169,7 +169,7 @@ public class RemoteXmppTcpConnectionEndpoints {
*
* @param domain the domain.
* @param domainType the XMPP domain type, server or client.
- * @param lookupFailures a list that will be populated with all failures that oocured during lookup.
+ * @param lookupFailures a list that will be populated with all failures that occurred during lookup.
* @param dnssecMode the DNSSEC mode.
* @param dnsResolver the DNS resolver to use.
* @return a list of resolved host addresses for this domain.
diff --git a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/WebSocketConnectionAttemptState.java b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/WebSocketConnectionAttemptState.java
index 80f58ab42..222aafc65 100644
--- a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/WebSocketConnectionAttemptState.java
+++ b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/WebSocketConnectionAttemptState.java
@@ -51,7 +51,7 @@ public final class WebSocketConnectionAttemptState {
/**
* Establish a websocket connection with one of the discoveredRemoteConnectionEndpoints.
*
- * @return {@link AbstractWebSocket} with which connection is establised
+ * @return {@link AbstractWebSocket} with which connection is established
* @throws InterruptedException if the calling thread was interrupted
*/
@SuppressWarnings({"incomplete-switch", "MissingCasesInEnumSwitch"})
diff --git a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java
index 435373203..55236858c 100644
--- a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java
+++ b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModule.java
@@ -135,7 +135,7 @@ public final class XmppWebSocketTransportModule
// TODO: It appears this should be done in a generic way. I'd assume we always
// have to wait for stream features after the connection was established. But I
- // am not yet 100% positive that this is the case for every transport. Hence keep it here for now(?).
+ // am not yet 100% positive that this is the case for every transport. Hence, keep it here for now(?).
// See also similar comment in XmppTcpTransportModule.
// Maybe move this into ConnectedButUnauthenticated state's transitionInto() method? That seems to be the
// right place.
@@ -157,7 +157,7 @@ public final class XmppWebSocketTransportModule
final WebSocketRemoteConnectionEndpoint connectedEndpoint;
public WebSocketConnectedResult(WebSocketRemoteConnectionEndpoint connectedEndpoint) {
- super("WebSocket connection establised with endpoint: " + connectedEndpoint);
+ super("WebSocket connection established with endpoint: " + connectedEndpoint);
this.connectedEndpoint = connectedEndpoint;
}
}
diff --git a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/rce/WebSocketRemoteConnectionEndpointLookup.java b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/rce/WebSocketRemoteConnectionEndpointLookup.java
index 347180f69..658814916 100644
--- a/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/rce/WebSocketRemoteConnectionEndpointLookup.java
+++ b/smack-websocket/src/main/java/org/jivesoftware/smack/websocket/rce/WebSocketRemoteConnectionEndpointLookup.java
@@ -77,7 +77,7 @@ public final class WebSocketRemoteConnectionEndpointLookup {
public Result(List lookupFailures) {
// The list of endpoints needs to be mutable, because maybe a user supplied endpoint will be added to it.
- // Hence we do not use Collections.emptyList() as argument for the discovered endpoints.
+ // Hence, we do not use Collections.emptyList() as argument for the discovered endpoints.
this(new ArrayList<>(1), new ArrayList<>(1), lookupFailures);
}
@@ -99,7 +99,7 @@ public final class WebSocketRemoteConnectionEndpointLookup {
// TODO: Remove the following methods since the fields are already public? Or make the fields private and use
// the methods? I tend to remove the methods, as their method name is pretty long. But OTOH the fields reference
- // mutable datastructes, which is uncommon to be public.
+ // mutable datastructures, which is uncommon to be public.
public List getDiscoveredSecureRemoteConnectionEndpoints() {
return discoveredSecureEndpoints;
}
diff --git a/smack-xmlparser/src/main/java/org/jivesoftware/smack/xml/XmlPullParser.java b/smack-xmlparser/src/main/java/org/jivesoftware/smack/xml/XmlPullParser.java
index c49ac66ae..fd5a5acfc 100644
--- a/smack-xmlparser/src/main/java/org/jivesoftware/smack/xml/XmlPullParser.java
+++ b/smack-xmlparser/src/main/java/org/jivesoftware/smack/xml/XmlPullParser.java
@@ -110,7 +110,7 @@ public interface XmlPullParser {
String getAttributeNamespace(int index);
/**
- * Returns the loacalpart of the attribute's name or null in case the index does not refer to an
+ * Returns the localpart of the attribute's name or null in case the index does not refer to an
* attribute.
*
* @param index the attribute index.
From b034e614d46d2fd4b102486fe5939d36c63ab2a2 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Thu, 12 Sep 2024 11:53:56 +0200
Subject: [PATCH 120/150] [github ci] Bump upload-artifact to v4
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cf69f7140..7d6507927 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -88,7 +88,7 @@ jobs:
# Upload build artifacts
- name: Upload build artifacts
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: smack-java-${{ matrix.java }}
path: |
From 6f0499b7f76ff9dcf10f091d1a9c016f4751d784 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Thu, 12 Sep 2024 14:36:20 +0200
Subject: [PATCH 121/150] [muc] Use BareJid for affiliation changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
As per XEP-0045 § 5.2 "Affiliations are granted, revoked, and
maintained based on the user's bare JID, not the nick as with roles."
Fixes SMACK-948
---
.../smackx/muc/MultiUserChat.java | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
index 9383d9e28..7ef1152d1 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
@@ -87,10 +87,10 @@ import org.jivesoftware.smackx.xdata.form.FillableForm;
import org.jivesoftware.smackx.xdata.form.Form;
import org.jivesoftware.smackx.xdata.packet.DataForm;
+import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityBareJid;
import org.jxmpp.jid.EntityFullJid;
-import org.jxmpp.jid.EntityJid;
import org.jxmpp.jid.Jid;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart;
@@ -1509,7 +1509,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void banUsers(Collection extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void banUsers(Collection extends BareJid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jids, MUCAffiliation.outcast);
}
@@ -1529,7 +1529,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void banUser(Jid jid, String reason) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void banUser(BareJid jid, String reason) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.outcast, reason);
}
@@ -1559,7 +1559,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void grantMembership(Jid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void grantMembership(BareJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.member, null);
}
@@ -1575,7 +1575,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void revokeMembership(Collection extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void revokeMembership(Collection extends BareJid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jids, MUCAffiliation.none);
}
@@ -1591,7 +1591,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void revokeMembership(Jid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void revokeMembership(BareJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.none, null);
}
@@ -1669,7 +1669,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void grantOwnership(Collection extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void grantOwnership(Collection extends BareJid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jids, MUCAffiliation.owner);
}
@@ -1685,7 +1685,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void grantOwnership(Jid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void grantOwnership(BareJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.owner, null);
}
@@ -1700,7 +1700,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void revokeOwnership(Collection extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void revokeOwnership(Collection extends BareJid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jids, MUCAffiliation.admin);
}
@@ -1715,7 +1715,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void revokeOwnership(Jid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void revokeOwnership(BareJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.admin, null);
}
@@ -1730,7 +1730,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void grantAdmin(Collection extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void grantAdmin(Collection extends BareJid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jids, MUCAffiliation.admin);
}
@@ -1746,7 +1746,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void grantAdmin(Jid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void grantAdmin(BareJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.admin);
}
@@ -1761,7 +1761,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void revokeAdmin(Collection extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void revokeAdmin(Collection extends BareJid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jids, MUCAffiliation.admin);
}
@@ -1777,7 +1777,7 @@ public class MultiUserChat {
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted.
*/
- public void revokeAdmin(EntityJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
+ public void revokeAdmin(BareJid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException {
changeAffiliationByAdmin(jid, MUCAffiliation.member);
}
From 4a101e2c993277917a1b533a4295980016bb2ee3 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sat, 14 Sep 2024 21:34:47 +0200
Subject: [PATCH 122/150] Delete APIs scheduled for removal with Smack 4.5
---
.../smack/AbstractConnectionListener.java | 51 ---
.../smack/AbstractXMPPConnection.java | 21 --
.../smack/ConnectionConfiguration.java | 41 +--
.../jivesoftware/smack/StanzaListener.java | 6 -
.../jivesoftware/smack/XMPPConnection.java | 47 ---
.../smack/packet/AbstractTextElement.java | 13 +-
.../org/jivesoftware/smack/packet/IQ.java | 14 -
.../jivesoftware/smack/packet/Message.java | 292 +-----------------
.../smack/packet/MessageOrPresence.java | 5 -
.../jivesoftware/smack/packet/Presence.java | 134 +-------
.../org/jivesoftware/smack/packet/Stanza.java | 76 -----
.../jivesoftware/smack/util/NumberUtil.java | 14 +-
.../jivesoftware/smack/util/ParserUtils.java | 17 +-
.../jivesoftware/smack/util/StringUtils.java | 20 +-
.../org/jivesoftware/smack/util/TLSUtils.java | 48 +--
.../smack/util/XmlStringBuilder.java | 16 +-
.../smackx/muclight/MultiUserChatLight.java | 15 -
.../smackx/sid/element/OriginIdElement.java | 22 --
.../smackx/bob/element/BoBIQ.java | 14 +-
.../smackx/disco/ServiceDiscoveryManager.java | 36 +--
.../smackx/disco/packet/DiscoverInfo.java | 114 -------
.../jiveproperties/JivePropertiesManager.java | 21 +-
.../muc/DefaultParticipantStatusListener.java | 98 ------
.../smackx/muc/DefaultUserStatusListener.java | 88 ------
.../smackx/muc/MucEnterConfiguration.java | 36 +--
.../smackx/muc/MultiUserChat.java | 63 +---
.../smackx/muc/MultiUserChatException.java | 4 +-
.../smackx/muc/MultiUserChatManager.java | 18 +-
.../jivesoftware/smackx/pep/PepManager.java | 28 +-
.../smackx/pubsub/ItemDeleteEvent.java | 2 +-
.../org/jivesoftware/smackx/pubsub/Node.java | 71 -----
.../smackx/pubsub/PubSubManager.java | 27 --
.../smackx/pubsub/SimplePayload.java | 21 --
.../smackx/vcardtemp/VCardManager.java | 2 +-
.../jivesoftware/smackx/xdata/FormField.java | 19 +-
.../smackx/xdata/packet/DataForm.java | 20 +-
.../org/jivesoftware/smack/chat/Chat.java | 14 +-
.../org/jivesoftware/smack/roster/Roster.java | 25 +-
38 files changed, 39 insertions(+), 1534 deletions(-)
delete mode 100644 smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java
delete mode 100644 smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java
delete mode 100644 smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java
deleted file mode 100644
index f4a6749b9..000000000
--- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- *
- * Copyright 2009 the original author or authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jivesoftware.smack;
-
-/**
- * The AbstractConnectionListener class provides an empty implementation for all
- * methods defined by the {@link ConnectionListener} interface. This is a
- * convenience class which should be used in case you do not need to implement
- * all methods.
- *
- * @author Henning Staib
- * @deprecated use {@link ConnectionListener} instead.
- */
-// TODO: Remove in Smack 4.5.
-@Deprecated
-public class AbstractConnectionListener implements ConnectionListener {
- @Override
- public void connected(XMPPConnection connection) {
- // do nothing
- }
-
- @Override
- public void authenticated(XMPPConnection connection, boolean resumed) {
- // do nothing
- }
-
- @Override
- public void connectionClosed() {
- // do nothing
- }
-
- @Override
- public void connectionClosedOnError(Exception e) {
- // do nothing
- }
-
-}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
index ae24f7f2b..8e3e66828 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
@@ -1242,27 +1242,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
});
}
- @Deprecated
- @Override
- public void addStanzaInterceptor(StanzaListener packetInterceptor,
- StanzaFilter packetFilter) {
- if (packetInterceptor == null) {
- throw new NullPointerException("Packet interceptor is null.");
- }
- InterceptorWrapper interceptorWrapper = new InterceptorWrapper(packetInterceptor, packetFilter);
- synchronized (interceptors) {
- interceptors.put(packetInterceptor, interceptorWrapper);
- }
- }
-
- @Deprecated
- @Override
- public void removeStanzaInterceptor(StanzaListener packetInterceptor) {
- synchronized (interceptors) {
- interceptors.remove(packetInterceptor);
- }
- }
-
private static , MP extends MessageOrPresence> void addInterceptor(
Map, GenericInterceptorWrapper> interceptors, Consumer interceptor,
Predicate filter) {
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
index 11e931f1a..6df0110f9 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2003-2007 Jive Software, 2017-2022 Florian Schmaus.
+ * Copyright 2003-2007 Jive Software, 2017-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -857,22 +857,6 @@ public abstract class ConnectionConfiguration {
return getThis();
}
- /**
- * Set the host to connect to by either its fully qualified domain name (FQDN) or its IP.
- *
- * @param fqdnOrIp a CharSequence either representing the FQDN or the IP of the host.
- * @return a reference to this builder.
- * @see #setHost(DnsName)
- * @see #setHostAddress(InetAddress)
- * @since 4.3.2
- * @deprecated use {@link #setHost(CharSequence)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public B setHostAddressByNameOrIp(CharSequence fqdnOrIp) {
- return setHost(fqdnOrIp);
- }
-
public B setPort(int port) {
if (port < 0 || port > 65535) {
throw new IllegalArgumentException(
@@ -1021,25 +1005,6 @@ public abstract class ConnectionConfiguration {
return getThis();
}
- /**
- * Sets a custom SSLContext for creating SSL sockets.
- *
- * For more information on how to create a SSLContext see Java Secure Socket Extension (JSEE) Reference Guide: Creating Your Own X509TrustManager
- *
- * @param context the custom SSLContext for new sockets.
- * @return a reference to this builder.
- * @deprecated use {@link #setSslContextFactory(SslContextFactory)} instead}.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- public B setCustomSSLContext(SSLContext context) {
- return setSslContextFactory(() -> {
- return context;
- });
- }
-
/**
* Sets a custom SSLContext for creating SSL sockets.
*
@@ -1186,7 +1151,9 @@ public abstract class ConnectionConfiguration {
if (!SASLAuthentication.isSaslMechanismRegistered(SASLMechanism.EXTERNAL)) {
throw new IllegalArgumentException("SASL " + SASLMechanism.EXTERNAL + " is not registered");
}
- setCustomSSLContext(sslContext);
+ setSslContextFactory(() -> {
+ return sslContext;
+ });
throwIfEnabledSaslMechanismsSet();
allowEmptyOrNullUsernames();
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java b/smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
index 52b3168c8..786c5a8b0 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
@@ -27,12 +27,6 @@ import org.jivesoftware.smack.packet.Stanza;
* the {@link #processStanza(Stanza)} method will be called. This is the
* opposite approach to the functionality provided by a {@link StanzaCollector}
* which lets you block while waiting for results.
- *
- * Additionally you are able to intercept Packets that are going to be send and
- * make modifications to them. You can register a PacketListener as interceptor
- * by using {@link XMPPConnection#addStanzaInterceptor(StanzaListener,
- * org.jivesoftware.smack.filter.StanzaFilter)}
- *
*
* @see XMPPConnection#addAsyncStanzaListener(StanzaListener, org.jivesoftware.smack.filter.StanzaFilter)
* @author Matt Tucker
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
index cbf05cc6e..c3bd2d414 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
@@ -423,7 +423,6 @@ public interface XMPPConnection {
*
* @param stanzaListener the stanza listener to notify of new received stanzas.
* @param stanzaFilter the stanza filter to use.
- * @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
* @since 4.1
*/
void addSyncStanzaListener(StanzaListener stanzaListener, StanzaFilter stanzaFilter);
@@ -449,7 +448,6 @@ public interface XMPPConnection {
*
* @param stanzaListener the stanza listener to notify of new received stanzas.
* @param stanzaFilter the stanza filter to use.
- * @see #addStanzaInterceptor(StanzaListener, StanzaFilter)
* @since 4.1
*/
void addAsyncStanzaListener(StanzaListener stanzaListener, StanzaFilter stanzaFilter);
@@ -483,34 +481,6 @@ public interface XMPPConnection {
*/
void removeStanzaSendingListener(StanzaListener stanzaListener);
- /**
- * Registers a stanza interceptor with this connection. The interceptor will be
- * invoked every time a stanza is about to be sent by this connection. Interceptors
- * may modify the stanza to be sent. A stanza filter determines which stanzas
- * will be delivered to the interceptor.
- *
- *
- * NOTE: For a similar functionality on incoming stanzas, see {@link #addAsyncStanzaListener(StanzaListener, StanzaFilter)}.
- *
- * This does not perform a deep clone, as extension elements are shared between the new and old
- * instance.
- *
- * @return a clone of this message.
- * @deprecated use {@link #asBuilder()} instead.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- @Override
- public Message clone() {
- return new Message(this);
- }
-
/**
* Represents a message subject, its language and the content of the subject.
*/
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresence.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresence.java
index f48b794a0..c3aa3d180 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresence.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/MessageOrPresence.java
@@ -20,11 +20,6 @@ import org.jivesoftware.smack.XMPPConnection;
public abstract class MessageOrPresence> extends Stanza {
- @Deprecated
- // TODO: Remove in Smack 4.5.
- protected MessageOrPresence() {
- }
-
protected MessageOrPresence(StanzaBuilder> stanzaBuilder) {
super(stanzaBuilder);
}
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java
index 3490e1a23..caa3942dc 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2003-2007 Jive Software, 2020-2021 Florian Schmaus.
+ * Copyright 2003-2007 Jive Software, 2020-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,12 +21,9 @@ import java.util.List;
import java.util.Locale;
import org.jivesoftware.smack.XMPPConnection;
-import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.XmlStringBuilder;
-import org.jxmpp.jid.Jid;
-
/**
* Represents XMPP presence stanzas. Every presence stanza has a type, which is one of
* the following values:
@@ -78,55 +75,6 @@ public final class Presence extends MessageOrPresence
private Mode mode = null;
- /**
- * Creates a new presence update. Status, priority, and mode are left un-set.
- *
- * @param type the type.
- * @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public Presence(Type type) {
- // Ensure that the stanza ID is set by calling super().
- super();
- setType(type);
- }
-
- /**
- * Creates a new presence with the given type and using the given XMPP address as recipient.
- *
- * @param to the recipient.
- * @param type the type.
- * @since 4.2
- * @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public Presence(Jid to, Type type) {
- this(type);
- setTo(to);
- }
-
- /**
- * Creates a new presence update with a specified status, priority, and mode.
- *
- * @param type the type.
- * @param status a text message describing the presence update.
- * @param priority the priority of this presence update.
- * @param mode the mode type for this presence update.
- * @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public Presence(Type type, String status, int priority, Mode mode) {
- // Ensure that the stanza ID is set by calling super().
- super();
- setType(type);
- setStatus(status);
- setPriority(priority);
- setMode(mode);
- }
-
Presence(PresenceBuilder presenceBuilder) {
super(presenceBuilder);
type = presenceBuilder.type;
@@ -186,36 +134,11 @@ public final class Presence extends MessageOrPresence
return type;
}
- /**
- * Sets the type of the presence packet.
- *
- * @param type the type of the presence packet.
- * @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void setType(Type type) {
- this.type = Objects.requireNonNull(type, "Type cannot be null");
- }
-
@Override
public String getStatus() {
return status;
}
- /**
- * Sets the status message of the presence update. The status is free-form text
- * describing a user's presence (i.e., "gone to lunch").
- *
- * @param status the status message.
- * @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void setStatus(String status) {
- this.status = status;
- }
-
@Override
public int getPriority() {
return getPriorityByte();
@@ -233,20 +156,11 @@ public final class Presence extends MessageOrPresence
* Sets the priority of the presence. The valid range is -128 through 127.
*
* @param priority the priority of the presence.
- * @throws IllegalArgumentException if the priority is outside the valid range.
* @see RFC 6121 § 4.7.2.3. Priority Element
* @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
*/
@Deprecated
- // TODO: Remove in Smack 4.5.
- public void setPriority(int priority) {
- if (priority < -128 || priority > 127) {
- throw new IllegalArgumentException("Priority value " + priority +
- " is not valid. Valid range is -128 through 127.");
- }
- setPriority((byte) priority);
- }
-
+ // TODO: Remove in Smack 4.6.
public void setPriority(byte priority) {
this.priority = priority;
}
@@ -259,19 +173,6 @@ public final class Presence extends MessageOrPresence
return mode;
}
- /**
- * Sets the mode of the presence update. A null presence mode value is interpreted
- * to be the same thing as {@link Presence.Mode#available}.
- *
- * @param mode the mode.
- * @deprecated use {@link PresenceBuilder} or {@link org.jivesoftware.smack.XMPPConnection#getStanzaFactory} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void setMode(Mode mode) {
- this.mode = mode;
- }
-
@Override
public String getElementName() {
return ELEMENT;
@@ -346,37 +247,6 @@ public final class Presence extends MessageOrPresence
return buf;
}
- /**
- * Creates and returns a copy of this presence stanza.
- *
- * This does not perform a deep clone, as extension elements are shared between the new and old
- * instance.
- *
- * According to the Encrypted
- * XMPP Manifesto, TLSv1.2 shall be deployed, providing fallback support for SSLv3 and
- * TLSv1.1. This method goes one step beyond and upgrades the handshake to use TLSv1 or better.
- * This method requires the underlying OS to support all of TLSv1.2 , 1.1 and 1.0.
- *
- *
- * @param builder the configuration builder to apply this setting to
- * @param Type of the ConnectionConfiguration builder.
- *
- * @return the given builder
- * @deprecated use {@link #setEnabledTlsProtocolsToRecommended(org.jivesoftware.smack.ConnectionConfiguration.Builder)} instead.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- public static > B setTLSOnly(B builder) {
- builder.setEnabledSSLProtocols(new String[] { PROTO_TLSV1_2, PROTO_TLSV1_1, PROTO_TLSV1 });
- return builder;
- }
-
- /**
- * Enable only TLS and SSLv3. Connections created with the given ConnectionConfiguration will
- * only support TLS and SSLv3.
- *
- * According to the Encrypted
- * XMPP Manifesto, TLSv1.2 shall be deployed, providing fallback support for SSLv3 and
- * TLSv1.1.
- *
- *
- * @param builder the configuration builder to apply this setting to
- * @param Type of the ConnectionConfiguration builder.
- *
- * @return the given builder
- * @deprecated use {@link #setEnabledTlsProtocolsToRecommended(org.jivesoftware.smack.ConnectionConfiguration.Builder)} instead.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- public static > B setSSLv3AndTLSOnly(B builder) {
- builder.setEnabledSSLProtocols(new String[] { PROTO_TLSV1_2, PROTO_TLSV1_1, PROTO_TLSV1, PROTO_SSL3 });
- return builder;
- }
-
/**
* Accept all TLS certificates.
*
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
index 3ecb67877..9eec876c4 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2014-2023 Florian Schmaus
+ * Copyright 2014-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -138,20 +138,6 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
return this;
}
- /**
- * Deprecated.
- *
- * @param element deprecated.
- * @return deprecated.
- * @deprecated use {@link #append(Element)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public XmlStringBuilder element(Element element) {
- assert element != null;
- return append(element.toXML());
- }
-
public XmlStringBuilder optElement(String name, String content) {
if (content != null) {
element(name, content);
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java
index 5ebd11197..77262c226 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java
@@ -181,21 +181,6 @@ public class MultiUserChatLight {
;
}
- /**
- * Sends a Message to the chat room.
- *
- * @param message TODO javadoc me please
- * the message.
- * @throws NotConnectedException if the XMPP connection is not connected.
- * @throws InterruptedException if the calling thread was interrupted.
- * @deprecated use {@link #sendMessage(MessageBuilder)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
- sendMessage(message.asBuilder());
- }
-
/**
* Sends a Message to the chat room.
*
diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java
index a50fd99e2..f0766de8b 100644
--- a/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java
+++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java
@@ -38,28 +38,6 @@ public class OriginIdElement extends StableAndUniqueIdElement {
super(id);
}
- /**
- * Add an origin-id element to a message and set the stanzas id to the same id as in the origin-id element.
- *
- * @param message message.
- * @return the added origin-id element.
- * @deprecated use {@link #addTo(MessageBuilder)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public static OriginIdElement addOriginId(Message message) {
- OriginIdElement originId = message.getExtension(OriginIdElement.class);
- if (originId != null) {
- return originId;
- }
-
- originId = new OriginIdElement();
- message.addExtension(originId);
- // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID.
- // message.setStanzaId(originId.getId());
- return originId;
- }
-
/**
* Add an origin-id element to a message and set the stanzas id to the same id as in the origin-id element.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBIQ.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBIQ.java
index 085df5fd5..2790e3860 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBIQ.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBIQ.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2016 Fernando Ramirez, 2020 Florian Schmaus
+ * Copyright 2016 Fernando Ramirez, 2020-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -65,18 +65,6 @@ public class BoBIQ extends IQ {
this(cid, null);
}
- /**
- * Get the BoB hash.
- *
- * @return the BoB hash
- * @deprecated use {@link #getContentId()} instead.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- public ContentId getBoBHash() {
- return cid;
- }
-
/**
* Get the BoB hash.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java
index 520806d0c..3953b9c63 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2003-2007 Jive Software, 2018-2022 Florian Schmaus.
+ * Copyright 2003-2007 Jive Software, 2018-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -442,27 +442,6 @@ public final class ServiceDiscoveryManager extends Manager {
return features.contains(feature);
}
- /**
- * Registers extended discovery information of this XMPP entity. When this
- * client is queried for its information this data form will be returned as
- * specified by XEP-0128.
- *
- *
- * Since no stanza is actually sent to the server it is safe to perform this
- * operation before logging to the server. In fact, you may want to
- * configure the extended info before logging to the server so that the
- * information is already available if it is required upon login.
- *
- * @param info the data form that contains the extend service discovery
- * information.
- * @deprecated use {@link #addExtendedInfo(DataForm)} instead.
- */
- // TODO: Remove in Smack 4.5
- @Deprecated
- public synchronized void setExtendedInfo(DataForm info) {
- addExtendedInfo(info);
- }
-
/**
* Registers extended discovery information of this XMPP entity. When this
* client is queried for its information this data form will be returned as
@@ -518,19 +497,6 @@ public final class ServiceDiscoveryManager extends Manager {
return CollectionUtil.newListWith(extendedInfos);
}
- /**
- * Returns the data form as List of PacketExtensions, or null if no data form is set.
- * This representation is needed by some classes (e.g. EntityCapsManager, NodeInformationProvider)
- *
- * @return the data form as List of PacketExtensions
- * @deprecated use {@link #getExtendedInfo()} instead.
- */
- // TODO: Remove in Smack 4.5
- @Deprecated
- public List getExtendedInfoAsList() {
- return getExtendedInfo();
- }
-
/**
* Removes the data form containing extended service discovery information
* from the information returned by this XMPP entity.
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
index 23be5dee5..08560bc25 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/packet/DiscoverInfo.java
@@ -17,7 +17,6 @@
package org.jivesoftware.smackx.disco.packet;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
@@ -83,17 +82,6 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
}
}
- /**
- * Deprecated.
- *
- * @deprecated use {@link DiscoverInfoBuilder} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public DiscoverInfo() {
- super(ELEMENT, NAMESPACE);
- }
-
/**
* Copy constructor.
*
@@ -114,85 +102,11 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
identitiesSet.addAll(d.identitiesSet);
}
- /**
- * Adds a new feature to the discovered information.
- *
- * @param feature the discovered feature
- * @return true if the feature did not already exist.
- * @deprecated use {@link DiscoverInfoBuilder#addFeature(String)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public boolean addFeature(String feature) {
- return addFeature(new Feature(feature));
- }
-
- /**
- * Adds a collection of features to the packet. Does noting if featuresToAdd is null.
- *
- * @param featuresToAdd TODO javadoc me please
- * @deprecated use {@link DiscoverInfoBuilder#addFeatures(Collection)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void addFeatures(Collection featuresToAdd) {
- if (featuresToAdd == null) return;
- for (String feature : featuresToAdd) {
- addFeature(feature);
- }
- }
-
- /**
- * Deprecated.
- *
- * @param feature the future.
- * @return true if the feature is new.
- * @deprecated use {@link DiscoverInfoBuilder#addFeature(DiscoverInfo.Feature)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public boolean addFeature(Feature feature) {
- features.add(feature);
- boolean featureIsNew = featuresSet.add(feature);
- if (!featureIsNew) {
- containsDuplicateFeatures = true;
- }
- return featureIsNew;
- }
-
@Override
public List getFeatures() {
return Collections.unmodifiableList(features);
}
- /**
- * Adds a new identity of the requested entity to the discovered information.
- *
- * @param identity the discovered entity's identity
- * @deprecated use {@link DiscoverInfoBuilder#addIdentity(DiscoverInfo.Identity)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void addIdentity(Identity identity) {
- identities.add(identity);
- identitiesSet.add(identity.getKey());
- }
-
- /**
- * Adds identities to the DiscoverInfo stanza.
- *
- * @param identitiesToAdd TODO javadoc me please
- * @deprecated use {@link DiscoverInfoBuilder#addIdentities(Collection)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void addIdentities(Collection identitiesToAdd) {
- if (identitiesToAdd == null) return;
- for (Identity identity : identitiesToAdd) {
- addIdentity(identity);
- }
- }
-
@Override
public List getIdentities() {
return Collections.unmodifiableList(identities);
@@ -232,22 +146,6 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
return node;
}
- /**
- * Sets the node attribute that supplements the 'jid' attribute. A node is merely
- * something that is associated with a JID and for which the JID can provide information.
- *
- * Node attributes SHOULD be used only when trying to provide or query information which
- * is not directly addressable.
- *
- * @param node the node attribute that supplements the 'jid' attribute
- * @deprecated use {@link DiscoverInfoBuilder#setNode(String)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void setNode(String node) {
- this.node = StringUtils.requireNullOrNotEmpty(node, "The node can not be the empty string");
- }
-
/**
* Returns true if the specified feature is part of the discovered information.
*
@@ -310,18 +208,6 @@ public class DiscoverInfo extends IQ implements DiscoverInfoView {
return new DiscoverInfoBuilder(this, stanzaId);
}
- /**
- * Deprecated, do not use.
- *
- * @deprecated use {@link #asBuilder(String)} instead.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- @Override
- public DiscoverInfo clone() {
- return new DiscoverInfo(this);
- }
-
public static DiscoverInfoBuilder builder(XMPPConnection connection) {
return new DiscoverInfoBuilder(connection);
}
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/JivePropertiesManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/JivePropertiesManager.java
index f02f56c8e..09bf70c5b 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/JivePropertiesManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jiveproperties/JivePropertiesManager.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2014 Florian Schmaus.
+ * Copyright 2014-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,25 +50,6 @@ public class JivePropertiesManager {
return javaObjectEnabled;
}
- /**
- * Convenience method to add a property to a packet.
- *
- * @param packet the stanza to add the property to.
- * @param name the name of the property to add.
- * @param value the value of the property to add.
- * @deprecated use {@link #addProperty(StanzaBuilder, String, Object)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public static void addProperty(Stanza packet, String name, Object value) {
- JivePropertiesExtension jpe = (JivePropertiesExtension) packet.getExtension(JivePropertiesExtension.NAMESPACE);
- if (jpe == null) {
- jpe = new JivePropertiesExtension();
- packet.addExtension(jpe);
- }
- jpe.setProperty(name, value);
- }
-
/**
* Convenience method to add a property to a stanza.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java
deleted file mode 100644
index a496077bc..000000000
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultParticipantStatusListener.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- *
- * Copyright 2003-2007 Jive Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jivesoftware.smackx.muc;
-
-import org.jxmpp.jid.EntityFullJid;
-import org.jxmpp.jid.Jid;
-import org.jxmpp.jid.parts.Resourcepart;
-
-/**
- * Default implementation of the ParticipantStatusListener interface.
- *
- * This class does not provide any behavior by default. It just avoids having
- * to implement all the interface methods if the user is only interested in implementing
- * some of the methods.
- *
- * @author Gaston Dombiak
- * @deprecated use {@link ParticipantStatusListener} instead.
- */
-// TODO: Remove in Smack 4.5
-@Deprecated
-public class DefaultParticipantStatusListener implements ParticipantStatusListener {
-
- @Override
- public void joined(EntityFullJid participant) {
- }
-
- @Override
- public void left(EntityFullJid participant) {
- }
-
- @Override
- public void kicked(EntityFullJid participant, Jid actor, String reason) {
- }
-
- @Override
- public void voiceGranted(EntityFullJid participant) {
- }
-
- @Override
- public void voiceRevoked(EntityFullJid participant) {
- }
-
- @Override
- public void banned(EntityFullJid participant, Jid actor, String reason) {
- }
-
- @Override
- public void membershipGranted(EntityFullJid participant) {
- }
-
- @Override
- public void membershipRevoked(EntityFullJid participant) {
- }
-
- @Override
- public void moderatorGranted(EntityFullJid participant) {
- }
-
- @Override
- public void moderatorRevoked(EntityFullJid participant) {
- }
-
- @Override
- public void ownershipGranted(EntityFullJid participant) {
- }
-
- @Override
- public void ownershipRevoked(EntityFullJid participant) {
- }
-
- @Override
- public void adminGranted(EntityFullJid participant) {
- }
-
- @Override
- public void adminRevoked(EntityFullJid participant) {
- }
-
- @Override
- public void nicknameChanged(EntityFullJid participant, Resourcepart newNickname) {
- }
-
-}
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java
deleted file mode 100644
index 44e396fb0..000000000
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- *
- * Copyright 2003-2007 Jive Software.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jivesoftware.smackx.muc;
-
-import org.jxmpp.jid.Jid;
-
-/**
- * Default implementation of the UserStatusListener interface.
- *
- * This class does not provide any behavior by default. It just avoids having
- * to implement all the interface methods if the user is only interested in implementing
- * some of the methods.
- *
- * @author Gaston Dombiak
- * @deprecated use {@link UserStatusListener} instead.
- */
-// TODO: Remove in Smack 4.5.
-@Deprecated
-public class DefaultUserStatusListener implements UserStatusListener {
-
- @Override
- public void kicked(Jid actor, String reason) {
- }
-
- @Override
- public void voiceGranted() {
- }
-
- @Override
- public void voiceRevoked() {
- }
-
- @Override
- public void banned(Jid actor, String reason) {
- }
-
- @Override
- public void membershipGranted() {
- }
-
- @Override
- public void membershipRevoked() {
- }
-
- @Override
- public void moderatorGranted() {
- }
-
- @Override
- public void moderatorRevoked() {
- }
-
- @Override
- public void ownershipGranted() {
- }
-
- @Override
- public void ownershipRevoked() {
- }
-
- @Override
- public void adminGranted() {
- }
-
- @Override
- public void adminRevoked() {
- }
-
- @Override
- public void roomDestroyed(MultiUserChat alternateMUC, String password, String reason) {
- }
-
-}
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java
index ef3e17ba7..e2a73dad1 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2015-2020 Florian Schmaus
+ * Copyright 2015-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,13 +60,8 @@ public final class MucEnterConfiguration {
since = builder.since;
timeout = builder.timeout;
- final PresenceBuilder joinPresenceBuilder;
- if (builder.joinPresence == null) {
- joinPresenceBuilder = builder.joinPresenceBuilder.ofType(Presence.Type.available);
- }
- else {
- joinPresenceBuilder = builder.joinPresence.asBuilder();
- }
+ final PresenceBuilder joinPresenceBuilder = builder.joinPresenceBuilder.ofType(Presence.Type.available);
+
// Indicate the client supports MUC
joinPresenceBuilder.addExtension(new MUCInitialPresence(password, maxChars, maxStanzas, seconds,
since));
@@ -95,9 +90,6 @@ public final class MucEnterConfiguration {
private final PresenceBuilder joinPresenceBuilder;
- // TODO: Remove in Smack 4.5.
- private Presence joinPresence;
-
Builder(Resourcepart nickname, XMPPConnection connection) {
this.nickname = Objects.requireNonNull(nickname, "Nickname must not be null");
@@ -107,28 +99,6 @@ public final class MucEnterConfiguration {
joinPresenceBuilder = connection.getStanzaFactory().buildPresenceStanza();
}
- /**
- * Set the presence used to join the MUC room.
- *
- * The 'to' value of the given presence will be overridden and the given presence must be of type
- * 'available', otherwise an {@link IllegalArgumentException} will be thrown.
- *
- *
- * @param presence TODO javadoc me please
- * @return a reference to this builder.
- * @deprecated use {@link #withPresence(Consumer)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public Builder withPresence(Presence presence) {
- if (presence.getType() != Presence.Type.available) {
- throw new IllegalArgumentException("Presence must be of type 'available'");
- }
-
- joinPresence = presence;
- return this;
- }
-
/**
* Set the presence used to join the MUC room.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
index d77b6415a..3c283adc5 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
@@ -718,7 +718,7 @@ public class MultiUserChat {
// nickname.
if (isJoined()) {
try {
- leaveSync();
+ leave();
}
catch (XMPPErrorException | NoResponseException | MucNotJoinedException e) {
LOGGER.log(Level.WARNING, "Could not leave MUC prior joining, assuming we are not joined", e);
@@ -738,23 +738,6 @@ public class MultiUserChat {
return getMyRoomJid() != null;
}
- /**
- * Leave the chat room.
- *
- * @return the leave presence as reflected by the MUC.
- * @throws NotConnectedException if the XMPP connection is not connected.
- * @throws InterruptedException if the calling thread was interrupted.
- * @throws XMPPErrorException if there was an XMPP error returned.
- * @throws NoResponseException if there was no response from the remote entity.
- * @throws MucNotJoinedException if not joined to the Multi-User Chat.
- * @deprecated use {@link #leave()} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public synchronized Presence leaveSync() throws NotConnectedException, InterruptedException, MucNotJoinedException, NoResponseException, XMPPErrorException {
- return leave();
- }
-
/**
* Leave the chat room.
*
@@ -1028,36 +1011,6 @@ public class MultiUserChat {
invite(connection.getStanzaFactory().buildMessageStanza(), user, reason);
}
- /**
- * Invites another user to the room in which one is an occupant using a given Message. The invitation
- * will be sent to the room which in turn will forward the invitation to the invitee.
- *
- * If the room is password-protected, the invitee will receive a password to use to join
- * the room. If the room is members-only, the invitee may be added to the member list.
- *
- * @param message the message to use for sending the invitation.
- * @param user the user to invite to the room.(e.g. hecate@shakespeare.lit)
- * @param reason the reason why the user is being invited.
- * @throws NotConnectedException if the XMPP connection is not connected.
- * @throws InterruptedException if the calling thread was interrupted.
- * @deprecated use {@link #invite(MessageBuilder, EntityBareJid, String)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5.
- public void invite(Message message, EntityBareJid user, String reason) throws NotConnectedException, InterruptedException {
- // TODO listen for 404 error code when inviter supplies a non-existent JID
- message.setTo(room);
-
- // Create the MUCUser packet that will include the invitation
- MUCUser mucUser = new MUCUser();
- MUCUser.Invite invite = new MUCUser.Invite(reason, user);
- mucUser.setInvite(invite);
- // Add the MUCUser packet that includes the invitation to the message
- message.addExtension(mucUser);
-
- connection.sendStanza(message);
- }
-
/**
* Invites another user to the room in which one is an occupant using a given Message. The invitation
* will be sent to the room which in turn will forward the invitation to the invitee.
- * According to XEP-4 § 3.2 the variable name (the 'var' attribute)
- * "uniquely identifies the field in the context of the form" (if the field is not of type 'fixed', in which case
- * the field "MAY possess a 'var' attribute")
- *
- *
- * @return the field's name.
- * @deprecated use {@link #getFieldName()} instead.
- */
- // TODO: Remove in Smack 4.5
- @Deprecated
- public String getVariable() {
- return getFieldName();
- }
-
/**
* Returns the field's name, also known as the variable name in case this is an filled out answer form.
*
diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/packet/DataForm.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/packet/DataForm.java
index 9ab354d57..e9f2da625 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/packet/DataForm.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/packet/DataForm.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2003-2007 Jive Software, 2020-2021 Florian Schmaus.
+ * Copyright 2003-2007 Jive Software, 2020-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@ import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.StanzaView;
import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.util.CollectionUtil;
-import org.jivesoftware.smack.util.Objects;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.XmlStringBuilder;
@@ -356,8 +355,7 @@ public final class DataForm implements ExtensionElement {
}
public static final class Builder {
- // TODO: Make this field final once setType() is gone.
- private Type type;
+ private final Type type;
private String title;
private List instructions;
private ReportedData reportedData;
@@ -409,20 +407,6 @@ public final class DataForm implements ExtensionElement {
}
}
- /**
- * Deprecated do not use.
- *
- * @param type the type.
- * @return a reference to this builder.
- * @deprecated use {@link DataForm#builder(Type)} instead.
- */
- @Deprecated
- // TODO: Remove in Smack 4.5 and then make this.type final.
- public Builder setType(Type type) {
- this.type = Objects.requireNonNull(type);
- return this;
- }
-
/**
* Sets the description of the data. It is similar to the title on a web page or an X window.
* You can put a <title/> on either a form to fill out, or a set of data results.
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java b/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java
index a00871964..a9cbe98b1 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/chat/Chat.java
@@ -133,10 +133,12 @@ public class Chat {
public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
// Force the recipient, message type, and thread ID since the user elected
// to send the message through this chat object.
- message.setTo(participant);
- message.setType(Message.Type.chat);
- message.setThread(threadID);
- chatManager.sendMessage(this, message);
+ Message chatMessage = message.asBuilder()
+ .to(participant)
+ .ofType(Message.Type.chat)
+ .setThread(threadID)
+ .build();
+ chatManager.sendMessage(this, chatMessage);
}
/**
@@ -199,10 +201,10 @@ public class Chat {
// Because the collector and listeners are expecting a thread ID with
// a specific value, set the thread ID on the message even though it
// probably never had one.
- message.setThread(threadID);
+ Message chatMessage = message.asBuilder().setThread(threadID).build();
for (ChatMessageListener listener : listeners) {
- listener.processMessage(this, message);
+ listener.processMessage(this, chatMessage);
}
}
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
index 4b38ef567..b51542015 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright 2003-2007 Jive Software, 2016-2022 Florian Schmaus.
+ * Copyright 2003-2007 Jive Software, 2016-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -218,7 +218,7 @@ public final class Roster extends Manager {
*
* This method will never return null, instead if the user has not yet logged into
* the server all modifying methods of the returned roster object
- * like {@link Roster#createEntry(BareJid, String, String[])},
+ * like {@link Roster#createItemAndRequestSubscription(BareJid, String, String[])},
* {@link Roster#removeEntry(RosterEntry)} , etc. except adding or removing
* {@link RosterListener}s will throw an IllegalStateException.
*
@@ -754,27 +754,6 @@ public final class Roster extends Manager {
return group;
}
- /**
- * Creates a new roster entry and presence subscription. The server will asynchronously
- * update the roster with the subscription status.
- *
- * @param user the user. (e.g. johndoe@jabber.org)
- * @param name the nickname of the user.
- * @param groups the list of group names the entry will belong to, or null if
- * the roster entry won't belong to a group.
- * @throws NoResponseException if there was no response from the server.
- * @throws XMPPErrorException if an XMPP exception occurs.
- * @throws NotLoggedInException If not logged in.
- * @throws NotConnectedException if the XMPP connection is not connected.
- * @throws InterruptedException if the calling thread was interrupted.
- * @deprecated use {@link #createItemAndRequestSubscription(BareJid, String, String[])} instead.
- */
- // TODO: Remove in Smack 4.5.
- @Deprecated
- public void createEntry(BareJid user, String name, String[] groups) throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
- createItemAndRequestSubscription(user, name, groups);
- }
-
/**
* Creates a new roster item. The server will asynchronously update the roster with the subscription status.
*
If the developer sets the language to null, this will also return null, leading to
- * the removal of the xml:lang tag from the stream. If a Locale("") is configured, this will
- * return "", which can be used as an override.
+ * the removal of the xml:lang tag from the stream.
*
- * @return the stream language to use when connecting to the server.
+ * @return the stream language to use when connecting to the server or null.
*/
public String getXmlLang() {
- // TODO: Change to Locale.toLanguageTag() once Smack's minimum Android API level is 21 or higher.
- // This will need a workaround for new Locale("").getLanguageTag() returning "und". Expected
- // behavior of this function:
- // - returns null if language is null
- // - returns "" if language.getLanguage() returns the empty string
- // - returns language.toLanguageTag() otherwise
- return language != null ? language.toString().replace("_", "-") : null;
+ if (language == null) {
+ return null;
+ }
+
+ String languageTag = language.toLanguageTag();
+ if (languageTag.equals("und")) {
+ return null;
+ }
+
+ return languageTag;
}
/**
From 1c1f57d9ffa92ae8db3c4aebb5c5f9d5b0cd4f8f Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sun, 15 Sep 2024 19:10:14 +0200
Subject: [PATCH 127/150] [core] Refine javadoc for
ConnectionConfiguration.getLanguage()
---
.../java/org/jivesoftware/smack/ConnectionConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
index 76b5a8e39..098f4b6a1 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
@@ -534,7 +534,7 @@ public abstract class ConnectionConfiguration {
/**
* Returns the stream language to use when connecting to the server.
*
- * @return the stream language to use when connecting to the server.
+ * @return the stream language to use when connecting to the server or null.
*/
public Locale getLanguage() {
return language;
From 8d7952cec354964497c31576fcc1e90fcf211d12 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sun, 15 Sep 2024 19:44:46 +0200
Subject: [PATCH 128/150] Bump MiniDNS version to 1.1.0-alpha3
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 9685a6b2f..7d1ca3285 100644
--- a/build.gradle
+++ b/build.gradle
@@ -141,7 +141,7 @@ allprojects {
// - https://issues.apache.org/jira/browse/MNG-6232
// - https://issues.igniterealtime.org/browse/SMACK-858
jxmppVersion = '[1.0.0, 1.0.999]'
- miniDnsVersion = '[1.0.0, 1.0.999]'
+ miniDnsVersion = '[1.1.0-alpha3, 1.1.999]'
smackMinAndroidSdk = 21
junitVersion = '5.7.1'
commonsIoVersion = '2.6'
From ab16e1a32cb0230c76aa5efb14dc2b2bc4d4db97 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sun, 15 Sep 2024 19:45:15 +0200
Subject: [PATCH 129/150] Bump jxmpp version to 1.1.0-beta1
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 7d1ca3285..8570669b9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -140,7 +140,7 @@ allprojects {
// See also:
// - https://issues.apache.org/jira/browse/MNG-6232
// - https://issues.igniterealtime.org/browse/SMACK-858
- jxmppVersion = '[1.0.0, 1.0.999]'
+ jxmppVersion = '[1.1.0-beta1, 1.1.999]'
miniDnsVersion = '[1.1.0-alpha3, 1.1.999]'
smackMinAndroidSdk = 21
junitVersion = '5.7.1'
From fd1f69203141f5c4b22cdf87708c7aa94672143d Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sun, 15 Sep 2024 19:50:40 +0200
Subject: [PATCH 130/150] Smack 4.5.0-beta2
---
version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version b/version
index b0a50c884..54e94febc 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-4.5.0-beta2-SNAPSHOT
+4.5.0-beta2
From 5a822a6631cdef5813eabf31d7a27493438a5159 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Sun, 15 Sep 2024 20:00:57 +0200
Subject: [PATCH 131/150] Smack 4.5.0-beta3-SNAPSHOT
---
version | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version b/version
index 54e94febc..5514d567b 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-4.5.0-beta2
+4.5.0-beta3-SNAPSHOT
From d8d066b831dd0f7005f62d5156e6de55d0e8021b Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Mon, 16 Sep 2024 08:59:04 +0200
Subject: [PATCH 132/150] [github ci] Install Android SDK 21
---
.github/workflows/ci.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 36bc92de9..20c87d49e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -52,10 +52,10 @@ jobs:
- name: Install GraphViz
run: sudo apt update && sudo apt install graphviz
- name: Install Android SDK Manager
- uses: android-actions/setup-android@v2
+ uses: android-actions/setup-android@v3
- name: Install Android SDK
run: |
- sdkmanager "platforms;android-19"
+ sdkmanager "platforms;android-21"
# Testing
- name: Gradle Check
From e4fcdb68795fe3d311a78cc44824b9e92c0c64ad Mon Sep 17 00:00:00 2001
From: Guus der Kinderen
Date: Wed, 18 Sep 2024 12:18:38 +0200
Subject: [PATCH 133/150] [sint] Fix compatibility with Smack 4.5.0-beta2
Due to a change in Smack 4.5.0-beta2, test execution of (all) SINT tests is aborted when `FormTest` is executed.
It appears that Smack now has more strict argument validation when setting thread IDs on message stanzas. This validation should not fail for the tests that are shipped with Smack.
This is the stack trace when executing the failing test (which no longer occurs after the change in this commit is applied):
```
Exception in thread "main" java.lang.IllegalArgumentException: thread must not be null nor empty
at org.jivesoftware.smack.util.StringUtils.requireNotNullNorEmpty(StringUtils.java:533)
at org.jivesoftware.smack.packet.Message$Thread.(Message.java:326)
at org.jivesoftware.smack.packet.MessageBuilder.setThread(MessageBuilder.java:70)
at org.jivesoftware.smack.packet.MessageBuilder.setThread(MessageBuilder.java:66)
at org.jivesoftware.smackx.xdata.FormTest.testFilloutForm(FormTest.java:133)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.lambda$runTests$0(SmackIntegrationTestFramework.java:476)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runConcreteTest(SmackIntegrationTestFramework.java:556)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework$PreparedTest.run(SmackIntegrationTestFramework.java:764)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runTests(SmackIntegrationTestFramework.java:544)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.run(SmackIntegrationTestFramework.java:277)
at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.main(SmackIntegrationTestFramework.java:115)
```
---
.../java/org/jivesoftware/smackx/xdata/FormTest.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
index 667beedb7..9e127b85e 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/xdata/FormTest.java
@@ -128,22 +128,22 @@ public class FormTest extends AbstractSmackIntegrationTest {
completedForm.setAnswer("time", true);
completedForm.setAnswer("age", 20);
// Create a new message to send with the completed form
- msg2 = StanzaBuilder.buildMessage()
+ Message msg3 = StanzaBuilder.buildMessage()
.to(conOne.getUser().asBareJid())
- .setThread(msg.getThread())
+ .setThread(msg2.getThread())
.ofType(Message.Type.chat)
.setBody("To enter a case please fill out this form and send it back to me")
// Add the completed form to the message
.addExtension(completedForm.getDataFormToSubmit())
.build();
// Send the message with the completed form
- conTwo.sendStanza(msg2);
+ conTwo.sendStanza(msg3);
// Get the message with the completed form
- Message msg3 = collector.nextResult();
- assertNotNull(msg3, "Message not found");
+ Message msg4 = collector.nextResult();
+ assertNotNull(msg4, "Message not found");
// Retrieve the completed form
- final DataForm completedForm2 = DataForm.from(msg3);
+ final DataForm completedForm2 = DataForm.from(msg4);
assertNotNull(completedForm2);
assertNotNull(completedForm2.getField("name"));
assertNotNull(completedForm2.getField("description"));
From 1e5d34eacf9a84f6dc2b5e918274d587bd35c030 Mon Sep 17 00:00:00 2001
From: Florian Schmaus
Date: Wed, 25 Sep 2024 11:43:47 +0200
Subject: [PATCH 134/150] Bump to Gradle 8.10.2, require Java 11
Bump Gradle from 6.8.3 to 8.10.2 and increase the minimum required
Java version from 8 to 11 (SMACK-953).
The switch from Java 8 to 11 caused some Bytecode portability issues
regarding NIO Buffers. Java changed with version 9 the return type of
some subclasses of Buffer to return the specific Buffer type instead
of the Buffer superclass [JDK-4774077]. For example, ByteBuffer.filp()
previously returned Buffer, while it does return ByteBuffer now.
This sensible change was not reflected by the Android API [1], which
means that AnimalSniffer rightfully started to complain that there is
no method "ByteBuffer ByteBuffer.flip()" in Android, there is only
"Buffer ByteBuffer.flip()", and those are incompatible methods on
Java's Bytecode layer.
As workaround, this changes
return charBuffer.flip().toString();
to
((java.nio.Buffer) charBuffer).flip();
return charBuffer.toString();
to restore the Bytecode portability between Android and Java.
Errorprone also got new checks, of which JavaUtilDate and JdkObsolete
are wroth mentioning.
JavaUtilData basically strongly recommends to use Java's newer time
API over java.util.Date. But since Smack was Java 8 until now,
j.u.Date is widely used.
Similar JdkObsolete mentions obsolete JDK APIs, like data structures
like Vector and Stack. But mostly LinkedList, which should usually be
replaced by ArrayList. And this is what this commit largely does.
JDK-4774077: https://bugs.openjdk.org/browse/JDK-4774077
1: https://issuetracker.google.com/issues/369219141
---
.github/workflows/ci.yml | 32 +-
Makefile | 30 +
build-logic/build.gradle | 16 +
build-logic/settings.gradle | 1 +
....android-boot-classpath-conventions.gradle | 6 +
...erealtime.smack.android-conventions.gradle | 10 +
...ltime.smack.application-conventions.gradle | 12 +
...terealtime.smack.global-conventions.gradle | 37 +
...ltime.smack.java-common-conventions.gradle | 373 ++++++++++
...erealtime.smack.javadoc-conventions.gradle | 30 +
build.gradle | 690 +-----------------
gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 43583 bytes
gradle/wrapper/gradle-wrapper.properties | 4 +-
gradlew | 297 +++++---
gradlew.bat | 37 +-
repl | 11 +-
resources/releasedocs/README.html | 221 ------
settings.gradle | 4 +
smack-android-extensions/build.gradle | 8 +-
smack-android/build.gradle | 20 +-
smack-bosh/build.gradle | 5 +
smack-core/build.gradle | 13 +-
.../smack/AbstractXMPPConnection.java | 15 +-
.../jivesoftware/smack/ScheduledAction.java | 4 +-
.../org/jivesoftware/smack/SmackReactor.java | 3 +-
.../jivesoftware/smack/StanzaCollector.java | 12 +-
.../jivesoftware/smack/XMPPConnection.java | 2 +
.../ModularXmppClientToServerConnection.java | 2 +-
.../zlib/ZlibXmppCompressionFactory.java | 16 +-
.../smack/debugger/ConsoleDebugger.java | 1 +
.../smack/initializer/UrlInitializer.java | 6 +-
.../smack/packet/AbstractError.java | 3 +-
.../jivesoftware/smack/packet/Mechanisms.java | 6 +-
.../packet/StandardExtensionElement.java | 4 +-
.../jivesoftware/smack/packet/StanzaView.java | 6 +-
.../smack/provider/ProviderFileLoader.java | 10 +-
.../smack/provider/ProviderManager.java | 4 +-
.../smack/sasl/core/ScramMechanism.java | 1 +
.../org/jivesoftware/smack/util/MultiMap.java | 5 +-
.../smack/util/PacketParserUtils.java | 7 +-
.../jivesoftware/smack/util/PacketUtil.java | 4 +-
.../org/jivesoftware/smack/util/Pair.java | 3 +-
.../jivesoftware/smack/util/StringUtils.java | 5 +-
.../smack/util/XmppElementUtil.java | 1 +
.../jivesoftware/smack/DummyConnection.java | 4 +-
smack-debug-slf4j/build.gradle | 4 +
smack-debug/build.gradle | 4 +
.../smackx/debugger/EnhancedDebugger.java | 3 +
.../debugger/EnhancedDebuggerWindow.java | 2 +-
smack-examples/build.gradle | 4 +
.../smack/examples/XmppTools.java | 3 +-
smack-experimental/build.gradle | 5 +
.../iot/data/element/IoTFieldsExtension.java | 1 +
.../element/JingleFileTransferChild.java | 3 +-
.../jivesoftware/smackx/mam/MamManager.java | 4 +-
.../spoiler/element/SpoilerElement.java | 1 +
.../element/TimestampAffixElement.java | 1 +
.../jivesoftware/smackx/mam/FiltersTest.java | 4 +-
smack-extensions/build.gradle | 5 +
.../ibb/InBandBytestreamManager.java | 6 +-
.../socks5/Socks5BytestreamManager.java | 5 +-
.../bytestreams/socks5/Socks5Proxy.java | 6 +-
.../smackx/caps/EntityCapsManager.java | 6 +-
.../smackx/disco/ServiceDiscoveryManager.java | 3 +-
.../smackx/disco/packet/DiscoverInfo.java | 3 +-
.../smackx/disco/packet/DiscoverItems.java | 4 +-
.../provider/RegistrationProvider.java | 4 +-
.../smackx/iqversion/packet/Version.java | 4 +-
.../last_interaction/element/IdleElement.java | 1 +
.../smackx/muc/MucEnterConfiguration.java | 2 -
.../smackx/muc/MultiUserChat.java | 4 +-
.../smackx/muc/MultiUserChatManager.java | 1 +
.../smackx/pubsub/ItemPublishEvent.java | 1 +
.../smackx/pubsub/packet/PubSub.java | 2 +-
.../jivesoftware/smackx/rsm/RSMManager.java | 8 +-
.../si/provider/StreamInitiationProvider.java | 1 +
.../smackx/caps/EntityCapsManagerTest.java | 6 +-
.../java/org/jivesoftware/util/Protocol.java | 1 +
smack-im/build.gradle | 8 +
.../jivesoftware/smack/roster/RosterUtil.java | 4 +-
smack-integration-test/build.gradle | 16 +-
.../smack/inttest/Configuration.java | 6 +-
.../SmackIntegrationTestFramework.java | 9 +-
.../java/org/jivesoftware/smack/ChatTest.java | 2 +-
smack-java8-full/build.gradle | 5 +
smack-java8/build.gradle | 8 +-
.../smack/java7/XmppHostnameVerifier.java | 8 +-
smack-jingle-old/build.gradle | 4 +
.../sshare/api/OctTreeQuantizer.java | 1 +
smack-legacy/build.gradle | 5 +
.../smackx/workgroup/agent/AgentRoster.java | 2 +-
.../smackx/workgroup/agent/AgentSession.java | 2 +
.../ext/history/AgentChatHistory.java | 2 +
.../smackx/workgroup/packet/QueueDetails.java | 1 +
.../smackx/workgroup/util/MetaDataUtils.java | 5 +-
.../build.gradle | 15 +-
smack-omemo-signal/build.gradle | 8 +
smack-omemo/build.gradle | 8 +
.../smackx/omemo/FileBasedOmemoStore.java | 7 +
.../smackx/omemo/OmemoService.java | 3 +
.../jivesoftware/smackx/omemo/OmemoStore.java | 2 +
.../smackx/omemo/OmemoServiceTest.java | 1 +
.../smackx/omemo/OmemoStoreTest.java | 4 +-
smack-openpgp/build.gradle | 8 +
.../smackx/ox/OpenPgpContact.java | 1 +
.../smackx/ox/OpenPgpManager.java | 1 +
.../jivesoftware/smackx/ox/OpenPgpSelf.java | 1 +
.../EncryptedOpenPgpContentElement.java | 3 +-
.../ox/element/OpenPgpContentElement.java | 2 +-
.../ox/element/PublicKeysListElement.java | 3 +-
.../OpenPgpContentElementProvider.java | 6 +-
.../FileBasedOpenPgpMetadataStore.java | 1 +
.../smackx/ox/util/OpenPgpPubSubUtil.java | 4 +-
.../smackx/ox/OpenPgpElementTest.java | 1 +
.../smackx/ox/OpenPgpStoreTest.java | 2 +
.../ox/PainlessOpenPgpProviderTest.java | 1 +
.../smackx/ox/PublicKeysListElementTest.java | 1 +
.../ox_im/OXInstantMessagingManagerTest.java | 1 +
smack-repl/build.gradle | 11 +-
smack-resolver-dnsjava/build.gradle | 5 +
smack-resolver-javax/build.gradle | 4 +
.../smack/util/dns/javax/JavaxResolver.java | 3 +-
smack-resolver-minidns-dox/build.gradle | 5 +
smack-resolver-minidns/build.gradle | 5 +
smack-sasl-javax/build.gradle | 4 +
smack-sasl-provided/build.gradle | 5 +
smack-streammanagement/build.gradle | 5 +
smack-tcp/build.gradle | 5 +
.../smack/tcp/XMPPTCPConnection.java | 3 +-
.../smack/tcp/XmppTcpTransportModule.java | 24 +-
smack-websocket-java11/build.gradle | 4 +
smack-websocket-okhttp/build.gradle | 5 +
smack-websocket/build.gradle | 5 +
smack-xmlparser-stax/build.gradle | 7 +-
smack-xmlparser-xpp3/build.gradle | 8 +-
smack-xmlparser/build.gradle | 8 +-
136 files changed, 1161 insertions(+), 1220 deletions(-)
create mode 100644 Makefile
create mode 100644 build-logic/build.gradle
create mode 100644 build-logic/settings.gradle
create mode 100644 build-logic/src/main/groovy/org.igniterealtime.smack.android-boot-classpath-conventions.gradle
create mode 100644 build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle
create mode 100644 build-logic/src/main/groovy/org.igniterealtime.smack.application-conventions.gradle
create mode 100644 build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle
create mode 100644 build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle
create mode 100644 build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle
delete mode 100644 resources/releasedocs/README.html
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 20c87d49e..5ddb006d2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,13 +6,13 @@ jobs:
build:
name: Build Smack
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-24.04
strategy:
matrix:
java:
- - 11
+ - 17
env:
- PRIMARY_JAVA_VERSION: 11
+ PRIMARY_JAVA_VERSION: 17
steps:
- name: Checkout
@@ -57,6 +57,17 @@ jobs:
run: |
sdkmanager "platforms;android-21"
+ # Workaround
+ - name: Create gradle.properties
+ run: |
+ cat <<-EOF > gradle.properties
+ # Workaround for https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/349
+ # suggested at https://docs.gradle.org/current/userguide/upgrading_version_8.html#xml_parsing_now_requires_recent_parsers
+ systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
+ systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
+ systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
+ EOF
+
# Testing
- name: Gradle Check
run: ./gradlew check --stacktrace
@@ -72,10 +83,19 @@ jobs:
# Test Coverage Report
- name: Jacoco Test Coverage
- if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
- run: ./gradlew jacocoRootReport coveralls
env:
- COVERALLS_REPO_TOKEN: S2ecSJja2cKJa9yv45C8ZFPohXuRrTXKd
+ COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
+ if: |
+ ${{ matrix.java == env.PRIMARY_JAVA_VERSION }} &&
+ ${{ env.COVERALLS_REPO_TOKEN != '' }}
+ run: |
+ if [[ -z ${COVERALLS_REPO_TOKEN} ]]; then
+ echo WARNING: COVERALLS_REPO_TOKEN is empty
+ else
+ echo COVERALLS_REPO_TOKEN is not empty
+ fi
+ ./gradlew smack-java8-full:testCodeCoverageReport
+ ./gradlew smack-java8-full:coveralls
# Upload build artifacts
- name: Upload build artifacts
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..0621bf85f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+GRADLE ?= ./gradlew
+
+.PHONY: all
+all: check jacocoRootReport javadocAll sinttest
+
+.PHONY: codecov
+codecov:
+ $(GRADLE) smack-java8-full:testCodeCoverageReport
+ echo "Report available at smack-java8-full/build/reports/jacoco/testCodeCoverageReport/html/index.html"
+
+.PHONY: check
+check:
+ $(GRADLE) $@
+
+.PHONY: eclipse
+eclipse:
+ $(GRADLE) $@
+
+.PHONY: sinttest
+sinttest:
+ $(GRADLE) $@
+
+.PHONY: jacocoRootReport
+jacocoRootReport:
+ $(GRADLE) $@
+
+.PHONY: javadocAll
+javadocAll:
+ $(GRADLE) $@
+ echo "Smack javadoc available at build/javadoc/index.html"
diff --git a/build-logic/build.gradle b/build-logic/build.gradle
new file mode 100644
index 000000000..795d644bd
--- /dev/null
+++ b/build-logic/build.gradle
@@ -0,0 +1,16 @@
+plugins {
+ id 'groovy-gradle-plugin'
+}
+
+repositories {
+ gradlePluginPortal()
+}
+
+dependencies {
+ implementation "biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0"
+ implementation "io.freefair.gradle:maven-plugin:8.10" // for io.freefair.agregate-javadoc
+ implementation "me.champeau.jmh:jmh-gradle-plugin:0.7.2"
+ implementation "net.ltgt.gradle:gradle-errorprone-plugin:4.0.1"
+ implementation "gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.2"
+ implementation "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
+}
diff --git a/build-logic/settings.gradle b/build-logic/settings.gradle
new file mode 100644
index 000000000..d082ce7e0
--- /dev/null
+++ b/build-logic/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'smack-build-logic'
diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.android-boot-classpath-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.android-boot-classpath-conventions.gradle
new file mode 100644
index 000000000..c14cb3199
--- /dev/null
+++ b/build-logic/src/main/groovy/org.igniterealtime.smack.android-boot-classpath-conventions.gradle
@@ -0,0 +1,6 @@
+compileJava {
+ options.bootstrapClasspath = files(androidBootClasspath)
+}
+javadoc {
+ classpath += files(androidBootClasspath)
+}
diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle
new file mode 100644
index 000000000..6f92548d3
--- /dev/null
+++ b/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle
@@ -0,0 +1,10 @@
+plugins {
+ id 'ru.vyarus.animalsniffer'
+ id 'org.igniterealtime.smack.global-conventions'
+}
+dependencies {
+ signature "net.sf.androidscents.signature:android-api-level-${smackMinAndroidSdk}:5.0.1_r2@signature"
+}
+animalsniffer {
+ sourceSets = [sourceSets.main]
+}
diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.application-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.application-conventions.gradle
new file mode 100644
index 000000000..fa4c7011e
--- /dev/null
+++ b/build-logic/src/main/groovy/org.igniterealtime.smack.application-conventions.gradle
@@ -0,0 +1,12 @@
+plugins {
+ id 'application'
+}
+
+application {
+ applicationDefaultJvmArgs = ["-enableassertions"]
+}
+
+run {
+ // Pass all system properties down to the "application" run
+ systemProperties System.getProperties()
+}
diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle
new file mode 100644
index 000000000..00fbff953
--- /dev/null
+++ b/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle
@@ -0,0 +1,37 @@
+ext {
+ javaVersion = JavaVersion.VERSION_11
+ javaMajor = javaVersion.getMajorVersion()
+ smackMinAndroidSdk = 21
+
+ androidBootClasspath = { getAndroidRuntimeJar() }
+}
+
+repositories {
+ mavenLocal()
+ mavenCentral()
+}
+
+def getAndroidRuntimeJar() {
+ def androidApiLevel = ext.smackMinAndroidSdk
+ def androidHome = getAndroidHome()
+ def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
+ if (androidJar.isFile()) {
+ return androidJar
+ } else {
+ throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package")
+ }
+}
+def getAndroidJavadocOffline() {
+ def androidHome = getAndroidHome()
+ return androidHome.toString() + "/docs/reference"
+}
+
+def getAndroidHome() {
+ def androidHomeEnv = System.getenv("ANDROID_HOME")
+ if (androidHomeEnv == null) {
+ throw new Exception("ANDROID_HOME environment variable is not set")
+ }
+ def androidHome = new File(androidHomeEnv)
+ if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
+ return androidHome
+}
diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle
new file mode 100644
index 000000000..e6a9ecbbf
--- /dev/null
+++ b/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle
@@ -0,0 +1,373 @@
+plugins {
+ id 'biz.aQute.bnd.builder'
+ id 'checkstyle'
+ id 'com.github.kt3k.coveralls'
+ id 'eclipse'
+ id 'idea'
+ id 'jacoco'
+ id 'java'
+ id 'java-library'
+ id 'java-test-fixtures'
+ id 'maven-publish'
+ id 'net.ltgt.errorprone'
+ id 'signing'
+
+ id 'jacoco-report-aggregation'
+ id 'test-report-aggregation'
+
+ id 'org.igniterealtime.smack.global-conventions'
+ id 'org.igniterealtime.smack.javadoc-conventions'
+}
+
+version readVersionFile()
+
+ext {
+ isSnapshot = version.endsWith('-SNAPSHOT')
+ gitCommit = getGitCommit()
+ rootConfigDir = new File(rootDir, 'config')
+ sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
+ isReleaseVersion = !isSnapshot
+ isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI'))
+ signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
+ sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
+ sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
+ builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
+ oneLineDesc = 'An Open Source XMPP (Jabber) client library'
+
+ jxmppVersion = '[1.1.0-beta1, 1.1.999]'
+ miniDnsVersion = '[1.1.0-alpha3, 1.1.999]'
+ junitVersion = '5.9.2'
+ commonsIoVersion = '2.6'
+ bouncyCastleVersion = '1.73'
+ guavaVersion = '30.1-jre'
+ mockitoVersion = '5.13.0'
+ orgReflectionsVersion = '0.9.11'
+
+ if (project.hasProperty("useSonatype")) {
+ useSonatype = project.getProperty("useSonatype").toBoolean()
+ } else {
+ // Default to true
+ useSonatype = true
+ }
+
+ gplLicensedProjects = [
+ ':smack-examples',
+ ':smack-omemo-signal',
+ ':smack-omemo-signal-integration-test',
+ ':smack-repl'
+ ].collect{ project(it) }
+}
+
+group = 'org.igniterealtime.smack'
+
+java {
+ sourceCompatibility = javaVersion
+ targetCompatibility = sourceCompatibility
+}
+
+eclipse {
+ classpath {
+ downloadJavadoc = true
+ }
+}
+
+// Make all project's 'test' target depend on javadoc, so that
+// javadoc is also linted.
+test.dependsOn javadoc
+
+tasks.withType(JavaCompile) {
+ // Some systems may not have set their platform default
+ // converter to 'utf8', but we use unicode in our source
+ // files. Therefore ensure that javac uses unicode
+ options.encoding = "utf8"
+ options.compilerArgs = [
+ '-Xlint:all',
+ // Set '-options' because a non-java7 javac will emit a
+ // warning if source/target is set to 1.7 and
+ // bootclasspath is *not* set.
+ '-Xlint:-options',
+ // TODO: Enable xlint serial
+ '-Xlint:-serial',
+ '-Werror',
+ ]
+}
+if (JavaVersion.current().isJava8Compatible()) {
+ tasks.withType(Javadoc) {
+ // The '-quiet' as second argument is actually a hack,
+ // since the one parameter addStringOption doesn't seem to
+ // work, we extra add '-quiet', which is added anyway by
+ // gradle.
+ // We disable 'missing' as we do most of javadoc checking via checkstyle.
+ options.addStringOption('Xdoclint:all,-missing', '-quiet')
+ // Abort on javadoc warnings.
+ // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363)
+ // for information about the -Xwerror option.
+ options.addStringOption('Xwerror', '-quiet')
+ }
+}
+
+if (JavaVersion.current().isJava9Compatible()) {
+ tasks.withType(JavaCompile) {
+ options.compilerArgs.addAll([
+ '--release', javaMajor,
+ ])
+ }
+}
+
+jacoco {
+ toolVersion = "0.8.12"
+}
+
+jacocoTestReport {
+ dependsOn test
+ reports {
+ xml.required = true
+ }
+}
+
+dependencies {
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
+
+ testFixturesApi "org.junit.jupiter:junit-jupiter-api:$junitVersion"
+ testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
+ // https://stackoverflow.com/a/77274251/194894
+ testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.11.0"
+
+ // The smack-extensions subproject uses mockito in its fest
+ // fixtures, and we want to have mockito also available in
+ // test, so we use API here.
+ testFixturesApi "org.mockito:mockito-core:${mockitoVersion}"
+
+ testImplementation 'com.jamesmurty.utils:java-xmlbuilder:1.2'
+
+ errorprone 'com.google.errorprone:error_prone_core:2.9.0'
+ errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
+}
+
+test {
+ useJUnitPlatform()
+
+ maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
+
+ // Enable full stacktraces of failed tests. Especially handy
+ // for CI environments.
+ testLogging {
+ events "failed"
+ exceptionFormat "full"
+ }
+}
+
+jar {
+ manifest {
+ attributes(
+ 'Implementation-Version': version,
+ 'Implementation-GitRevision': gitCommit,
+ 'Built-JDK': System.getProperty('java.version'),
+ 'Built-Gradle': gradle.gradleVersion,
+ 'Built-By': System.getProperty('user.name')
+ )
+ }
+
+ bundle {
+ bnd(
+ '-removeheaders': 'Tool, Bnd-*',
+ '-exportcontents': '*',
+ )
+ }
+}
+
+checkstyle {
+ toolVersion = '8.27'
+
+ if (project in gplLicensedProjects) {
+ configProperties.checkstyleLicenseHeader = "${project.name}-gplv3-license-header"
+ } else {
+ configProperties.checkstyleLicenseHeader = "header"
+ }
+}
+task sourcesJar(type: Jar, dependsOn: classes) {
+ archiveClassifier = 'sources'
+ from sourceSets.main.allSource
+}
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ archiveClassifier = 'javadoc'
+ from javadoc.destinationDir
+}
+task testsJar(type: Jar) {
+ archiveClassifier = 'tests'
+ from sourceSets.test.output
+}
+configurations {
+ testRuntime
+}
+artifacts {
+ // Add a 'testRuntime' configuration including the tests so that
+ // it can be consumed by other projects (smack-omemo-signal for
+ // example). See http://stackoverflow.com/a/21946676/194894
+ testRuntime testsJar
+}
+
+publishing {
+ publications {
+ mavenJava(MavenPublication) {
+ from components.java
+ artifact sourcesJar
+ artifact javadocJar
+ artifact testsJar
+ pom {
+ name = 'Smack'
+ packaging = 'jar'
+ inceptionYear = '2003'
+ url = 'http://www.igniterealtime.org/projects/jxmpp/'
+ afterEvaluate {
+ description = project.description
+ }
+
+ issueManagement {
+ system = 'JIRA'
+ url = 'http://issues.igniterealtime.org/browse/SMACK'
+ }
+
+ scm {
+ url = 'https://github.com/igniterealtime/Smack'
+ connection = 'scm:git:https://github.com/igniterealtime/Smack.git'
+ developerConnection = 'scm:git:https://github.com/igniterealtime/Smack.git'
+ }
+
+ licenses {
+ if (project in gplLicensedProjects) {
+ license {
+ name = 'GNU General Public License, version 3 or any later version'
+ url = 'https://www.gnu.org/licenses/gpl.txt'
+ distribution = 'repo'
+ }
+ } else {
+ license {
+ name = 'The Apache Software License, Version 2.0'
+ url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution = 'repo'
+ }
+ }
+ }
+
+ developers {
+ developer {
+ id = 'flow'
+ name = 'Florian Schmaus'
+ email = 'flow@igniterealtime.org'
+ }
+ }
+ }
+ }
+ }
+ repositories {
+ if (sonatypeCredentialsAvailable && useSonatype) {
+ maven {
+ url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
+ credentials {
+ username = sonatypeUsername
+ password = sonatypePassword
+ }
+ }
+ }
+ // Use
+ // gradle publish -P customRepoUrl=https://www.igniterealtime.org/archiva/repository/maven -P customRepoUsername=bamboo -P customRepoPassword=hidden -P useSonatype=false
+ // to deploy to this repo.
+ if (project.hasProperty("customRepoUrl")) {
+ maven {
+ name 'customRepo'
+ url customRepoUrl
+ if (project.hasProperty("customRepoUsername")) {
+ credentials {
+ username customRepoUsername
+ password customRepoPassword
+ }
+ }
+ }
+ }
+ }
+}
+
+// Workaround for gpg signatory not supporting the 'required' option
+// See https://github.com/gradle/gradle/issues/5064#issuecomment-381924984
+// Note what we use 'signing.gnupg.keyName' instead of 'signing.keyId'.
+tasks.withType(Sign) {
+ onlyIf {
+ project.hasProperty('signing.gnupg.keyName')
+ }
+}
+signing {
+ required { signingRequired }
+ useGpgCmd()
+ sign publishing.publications.mavenJava
+}
+
+tasks.withType(JavaCompile) {
+ options.errorprone {
+ disableWarningsInGeneratedCode = true
+ excludedPaths = ".*/jmh_generated/.*"
+ error(
+ "UnusedVariable",
+ "UnusedMethod",
+ "MethodCanBeStatic",
+ )
+ errorproneArgs = [
+ // Disable MissingCasesInEnumSwitch error prone check
+ // because this check is already done by javac as incomplete-switch.
+ '-Xep:MissingCasesInEnumSwitch:OFF',
+ '-Xep:StringSplitter:OFF',
+ '-Xep:JavaTimeDefaultTimeZone:OFF',
+ '-Xep:InlineMeSuggester:OFF',
+ ]
+ }
+}
+
+// Work around https://github.com/gradle/gradle/issues/4046
+task copyJavadocDocFiles(type: Copy) {
+ from('src/javadoc')
+ into 'build/docs/javadoc'
+ include '**/doc-files/*.*'
+}
+javadoc.dependsOn copyJavadocDocFiles
+
+coveralls {
+ jacocoReportPath 'build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml'
+}
+
+def getGitCommit() {
+ def projectDirFile = new File("$projectDir")
+
+ def cmd = 'git describe --always --tags --dirty=+'
+ def proc = cmd.execute(null, projectDirFile)
+
+ def exitStatus = proc.waitFor()
+ if (exitStatus != 0) return "non-git build"
+
+ def gitCommit = proc.text.trim()
+ assert !gitCommit.isEmpty()
+ gitCommit
+}
+
+def getAndroidRuntimeJar() {
+ def androidHome = new File("$System.env.ANDROID_HOME")
+ if (!androidHome.isDirectory()) throw new Exception("ANDROID_HOME not found or set")
+ def androidJar = new File("$androidHome/platforms/android-$smackMinAndroidSdk/android.jar")
+ if (androidJar.isFile()) {
+ return androidJar
+ } else {
+ throw new Exception("Can't find android.jar for $smackMinAndroidSdk API. Please install corresponding SDK platform package")
+ }
+}
+
+def readVersionFile() {
+ def versionFile = new File(rootDir, 'version')
+ if (!versionFile.isFile()) {
+ throw new Exception("Could not find version file")
+ }
+ if (versionFile.text.isEmpty()) {
+ throw new Exception("Version file does not contain a version")
+ }
+ versionFile.text.trim()
+}
diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle
new file mode 100644
index 000000000..61cb8f3c6
--- /dev/null
+++ b/build-logic/src/main/groovy/org.igniterealtime.smack.javadoc-conventions.gradle
@@ -0,0 +1,30 @@
+plugins {
+ // Javadoc linking requires repositories to bet configured. And
+ // those are declared in global-conventions, hence we add it here.
+ id 'org.igniterealtime.smack.global-conventions'
+}
+
+if (JavaVersion.current().isJava8Compatible()) {
+ tasks.withType(Javadoc) {
+ // The '-quiet' as second argument is actually a hack,
+ // since the one parameter addStringOption doesn't seem to
+ // work, we extra add '-quiet', which is added anyway by
+ // gradle.
+ // We disable 'missing' as we do most of javadoc checking via checkstyle.
+ options.addStringOption('Xdoclint:all,-missing', '-quiet')
+ // Abort on javadoc warnings.
+ // See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363)
+ // for information about the -Xwerror option.
+ options.addStringOption('Xwerror', '-quiet')
+ }
+}
+
+if (JavaVersion.current().isJava9Compatible()) {
+ tasks.withType(Javadoc) {
+ options.addStringOption('-release', javaMajor)
+ }
+}
+
+tasks.withType(Javadoc) {
+ options.charSet = "UTF-8"
+}
diff --git a/build.gradle b/build.gradle
index 8570669b9..13f9b12d7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,346 +1,20 @@
-buildscript {
- repositories {
- gradlePluginPortal()
- }
-}
-
plugins {
- id 'ru.vyarus.animalsniffer' version '1.5.0'
- id 'net.ltgt.errorprone' version '1.3.0'
- // Use e.g. "gradle taskTree" to show its dependency tree.
- id 'com.dorongold.task-tree' version '1.5'
- id 'com.github.kt3k.coveralls' version '2.10.2'
- id 'biz.aQute.bnd.builder' version '6.4.0'
+ // The scalastyle plugin of smack-repl wants the root project to
+ // have a ideaProject task, so let's add one.
+ id 'idea'
+
+ id 'org.igniterealtime.smack.javadoc-conventions'
}
ext {
- java11Projects = [
- ':smack-examples',
+ javadocAllDir = new File(buildDir, 'javadoc')
+ integrationTestProjects = [
':smack-integration-test',
':smack-omemo-signal-integration-test',
- ':smack-repl',
- ':smack-websocket-java11',
- ].collect { project(it) }
- java11Projects += getRootProject()
- java8Projects = allprojects - java11Projects
+ ].collect{ project(it) }
+ javadocAllProjects = subprojects - integrationTestProjects
}
-configure (java8Projects) {
- ext {
- javaCompatilibity = JavaVersion.VERSION_1_8
- }
-}
-
-configure (java11Projects) {
- ext {
- javaCompatilibity = JavaVersion.VERSION_11
- }
-}
-
-allprojects {
- apply plugin: 'java-library'
- apply plugin: 'java-test-fixtures'
- apply plugin: 'eclipse'
- apply plugin: 'idea'
- apply plugin: 'jacoco'
- apply plugin: 'net.ltgt.errorprone'
-
- version readVersionFile()
-
- ext {
- isSnapshot = version.endsWith('-SNAPSHOT')
- gitCommit = getGitCommit()
- javadocAllDir = new File(buildDir, 'javadoc')
- documentationDir = new File(projectDir, 'documentation')
- releasedocsDir = new File(buildDir, 'releasedocs')
- rootConfigDir = new File(rootDir, 'config')
- sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
- isReleaseVersion = !isSnapshot
- isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI'))
- signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
- sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
- sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
- // Returns only the date in yyyy-MM-dd format, as otherwise, with
- // hh:mm:ss information, the manifest files would change with every
- // build, causing unnecessary rebuilds.
- builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
- oneLineDesc = 'An Open Source XMPP (Jabber) client library'
- integrationTestProjects = [
- ':smack-integration-test',
- ':smack-omemo-signal-integration-test',
- ].collect{ project(it) }
- javadocAllProjects = subprojects - integrationTestProjects
- // A dirty hack used for Gradle's jacoco plugin, since is not
- // hable to handle the case when a (sub)project has no unit
- // tests. :-(
- projectsWithoutUnitTests = [
- ':smack-android',
- ':smack-android-extensions',
- ':smack-bosh',
- ':smack-debug',
- ':smack-debug-slf4j',
- ':smack-java8',
- ':smack-jingle-old',
- ':smack-resolver-dnsjava',
- ':smack-resolver-javax',
- ':smack-resolver-minidns',
- ':smack-omemo-signal-integration-test',
- ].collect{ project(it) }
- projectsWithUnitTests = subprojects - projectsWithoutUnitTests
- androidProjects = [
- ':smack-tcp',
- ':smack-bosh',
- ':smack-core',
- ':smack-im',
- ':smack-resolver-minidns',
- ':smack-sasl-provided',
- ':smack-extensions',
- ':smack-experimental',
- ':smack-omemo',
- ':smack-omemo-signal',
- ':smack-openpgp',
- ':smack-xmlparser',
- ':smack-xmlparser-xpp3',
- ].collect{ project(it) }
- androidBootClasspathProjects = [
- ':smack-android',
- ':smack-android-extensions',
- ].collect{ project(it) }
- androidOptionalProjects = [
- ':smack-tcp',
- ':smack-extensions',
- ':smack-experimental',
- ':smack-bosh',
- ':smack-omemo',
- ':smack-omemo-signal',
- ].collect{ project(it) }
- gplLicensedProjects = [
- ':smack-examples',
- ':smack-omemo-signal',
- ':smack-omemo-signal-integration-test',
- ':smack-repl'
- ].collect{ project(it) }
- // Lazily evaluate the Android bootClasspath and offline
- // Javadoc using a closure, so that targets which do not
- // require it are still able to succeed without an Android
- // SDK.
- androidBootClasspath = { getAndroidRuntimeJar() }
- androidJavadocOffline = { getAndroidJavadocOffline() }
- junit4Projects = [
- ':smack-core',
- ':smack-im',
- ':smack-omemo',
- ':smack-omemo-signal',
- ':smack-openpgp',
- ].collect { project(it) }
-
- // When using dynamic versions for those, do *not* use [1.0,
- // 2.0), since this will also pull in 2.0-alpha1. Instead use
- // [1.0, 1.0.99].
- // See also:
- // - https://issues.apache.org/jira/browse/MNG-6232
- // - https://issues.igniterealtime.org/browse/SMACK-858
- jxmppVersion = '[1.1.0-beta1, 1.1.999]'
- miniDnsVersion = '[1.1.0-alpha3, 1.1.999]'
- smackMinAndroidSdk = 21
- junitVersion = '5.7.1'
- commonsIoVersion = '2.6'
- bouncyCastleVersion = '1.73'
- guavaVersion = '30.1-jre'
- mockitoVersion = '3.7.7'
- orgReflectionsVersion = '0.9.11'
-
- if (project.hasProperty("useSonatype")) {
- useSonatype = project.getProperty("useSonatype").toBoolean()
- } else {
- // Default to true
- useSonatype = true
- }
- javaMajor = javaCompatilibity.getMajorVersion()
- }
- group = 'org.igniterealtime.smack'
- sourceCompatibility = javaCompatilibity
- targetCompatibility = sourceCompatibility
-
- test {
- useJUnitPlatform()
-
- maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
-
- // Enable full stacktraces of failed tests. Especially handy
- // for environments like Travis.
- testLogging {
- events "failed"
- exceptionFormat "full"
- }
- }
-
- ext.sharedManifest = manifest {
- attributes('Implementation-Version': version,
- 'Implementation-GitRevision': ext.gitCommit,
- 'Built-Date': ext.builtDate,
- 'Built-JDK': System.getProperty('java.version'),
- 'Built-Gradle': gradle.gradleVersion,
- 'Built-By': System.getProperty('user.name')
- )
- }
-
- eclipse {
- classpath {
- downloadJavadoc = true
- }
- }
-
- repositories {
- mavenLocal()
- mavenCentral()
- }
-
- tasks.withType(JavaCompile) {
- // Some systems may not have set their platform default
- // converter to 'utf8', but we use unicode in our source
- // files. Therefore ensure that javac uses unicode
- options.encoding = 'UTF-8'
- options.compilerArgs = [
- '-Xlint:all',
- // Set '-options' because a non-java7 javac will emit a
- // warning if source/target is set to 1.7 and
- // bootclasspath is *not* set.
- // TODO implement a sound heuristic to determine a java7
- // rt.jar on the build host. And if none is found,
- // fallback to using a environment variable,
- // e.g. JAVA7_HOME. See SMACK-651.
- '-Xlint:-options',
- '-Werror',
- ]
- options.errorprone {
- error(
- "UnusedVariable",
- "UnusedMethod",
- "MethodCanBeStatic",
- )
- errorproneArgs = [
- // Disable errorprone checks
- '-Xep:TypeParameterUnusedInFormals:OFF',
- // Disable errorpone StringSplitter check, as it
- // recommends using Splitter from Guava, which we don't
- // have (nor want to use in Smack).
- '-Xep:StringSplitter:OFF',
- '-Xep:JdkObsolete:OFF',
- // Disabled because sinttest re-uses BeforeClass from junit.
- // TODO: change sinttest so that it has it's own
- // BeforeClass and re-enable this check.
- '-Xep:JUnit4ClassAnnotationNonStatic:OFF',
- // Disabled but should be re-enabled at some point
- //'-Xep:InconsistentCapitalization:OFF',
- '-Xep:MixedMutabilityReturnType:OFF',
- // TODO: Re-enable once Smack's minimum Android SDK level is 26 or higher.
- '-Xep:JavaUtilDate:OFF',
- ]
- }
- }
-
- tasks.withType(ScalaCompile) {
- scalaCompileOptions.additionalParameters = [
- '-Xfatal-warnings',
- '-feature',
- ]
- }
-
- jacoco {
- toolVersion = "0.8.6"
- }
-
- jacocoTestReport {
- dependsOn test
- getSourceDirectories().setFrom(project.files(sourceSets.main.allSource.srcDirs))
- getClassDirectories().setFrom(project.files(sourceSets.main.output))
- reports {
- xml.enabled true
- }
- }
-
- if (JavaVersion.current().isJava8Compatible()) {
- tasks.withType(Javadoc) {
- // The '-quiet' as second argument is actually a hack,
- // since the one parameter addStringOption doesn't seem to
- // work, we extra add '-quiet', which is added anyway by
- // gradle.
- // TODO: This enables all doclint check but
- // 'missing'. Re-enable 'missing' once every public API in
- // Smack has a javadoc comment.
- options.addStringOption('Xdoclint:accessibility,html,reference,syntax', '-quiet')
-
- // Treat warnings as errors.
- // See also https://bugs.openjdk.java.net/browse/JDK-8200363
- options.addStringOption('Xwerror', '-quiet')
- }
- }
-
- if (JavaVersion.current().isJava9Compatible()) {
- tasks.withType(Javadoc) {
- options.addStringOption('-release', javaMajor)
-
- // The -no-modules-directories javadoc option was removed in Java 13
- // See https://bugs.openjdk.java.net/browse/JDK-8215582
- if (JavaVersion.current() < JavaVersion.VERSION_13) {
- // Fix for javadoc search. If not set, the search result would direct to
- // javadoc/undefined/org/jivesoftware/smack/altconnections/HttpLookupMethod.html
- // instead of
- // javadoc/org/jivesoftware/smack/altconnections/HttpLookupMethod.html
- // https://stackoverflow.com/a/53732633/194894
- options.addBooleanOption("-no-module-directories", true)
- }
- }
- tasks.withType(JavaCompile) {
- options.compilerArgs.addAll([
- '--release', javaMajor,
- ])
- }
- }
-
-tasks.withType(Javadoc) {
- options.charSet = "UTF-8"
- options.encoding = 'UTF-8'
- }
-
- dependencies {
- testFixturesApi "org.junit.jupiter:junit-jupiter-api:$junitVersion"
- testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
- testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
- // https://stackoverflow.com/a/77274251/194894
- testRuntimeOnly "org.junit.platform:junit-platform-launcher"
-
- // The smack-extensions subproject uses mockito in its fest
- // fixtures, and we want to have mockito also available in
- // test, so we use API here.
- testFixturesApi "org.mockito:mockito-core:${mockitoVersion}"
-
- // To mock final classes
- testImplementation "org.mockito:mockito-inline:${mockitoVersion}"
- testImplementation 'com.jamesmurty.utils:java-xmlbuilder:1.2'
-
- errorprone 'com.google.errorprone:error_prone_core:2.5.1'
- errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
- }
-
- // Make all project's 'test' target depend on javadoc, so that
- // javadoc is also linted.
- test { dependsOn javadoc }
-}
-
-configure (junit4Projects) {
- dependencies {
- testImplementation "org.junit.vintage:junit-vintage-engine:$junitVersion"
- }
-}
-
-// We need to evaluate the child projects first because
-// - javadocAll needs the smack-core child to have already resolved
-// the jXMPP/MiniDNS dependencies, so that we can the resolved
-// version to link to those project's javadoc.
-// - We use the child's project description as description for the
-// Maven POM.
evaluationDependsOnChildren()
task javadocAll(type: Javadoc) {
source javadocAllProjects.collect {project ->
@@ -389,286 +63,6 @@ task javadocAll(type: Javadoc) {
}
}
-import org.apache.tools.ant.filters.ReplaceTokens
-task prepareReleasedocs(type: Copy) {
- from 'resources/releasedocs'
- into releasedocsDir
- filter(ReplaceTokens, tokens: [version: version, releasedate: builtDate, targetCompatibility: targetCompatibility.toString()])
-}
-
-task distributionZip(type: Zip, dependsOn: [javadocAll, prepareReleasedocs]) {
- classifier builtDate
- into ('javadoc') {
- from(javadocAllDir)
- }
- into ('releasedocs') {
- from(releasedocsDir)
- }
- into ('releasedocs/documentation') {
- from(documentationDir)
- }
-}
-
-task maybeCheckForSnapshotDependencies {
- // Don't check for Snapshot dependencies if this is a snapshot.
- onlyIf { isReleaseVersion }
- // Run in the execution phase, not in configuration phase, as the
- // 'each' forces the runtime configuration to be resolved, which
- // causes "Cannot change dependencies of configuration after it
- // has been included in dependency resolution." errors.
- // See https://discuss.gradle.org/t/23153
- doLast {
- allprojects { project ->
- project.configurations.runtime.each {
- if (it.toString().contains("-SNAPSHOT"))
- throw new Exception("Release build contains snapshot dependencies: " + it)
- }
- }
- }
-}
-
-test { dependsOn maybeCheckForSnapshotDependencies }
-
-jar {
- // Root project should not create empty jar artifact
- enabled = false
-}
-
-// Disable upload archives for the root project
-uploadArchives.enabled = false
-
-description = """\
-Smack ${version}
-${oneLineDesc}."""
-
-subprojects {
- apply plugin: 'maven-publish'
- apply plugin: 'signing'
- apply plugin: 'checkstyle'
- apply plugin: 'biz.aQute.bnd.builder'
-
- checkstyle {
- toolVersion = '8.27'
- }
- task sourcesJar(type: Jar, dependsOn: classes) {
- classifier = 'sources'
- from sourceSets.main.allSource
- }
- task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
- }
- task testsJar(type: Jar, dependsOn: testClasses) {
- classifier = 'tests'
- from sourceSets.test.output
- }
-
- artifacts {
- // See http://stackoverflow.com/a/21946676/194894
- testRuntime testsJar
- }
-
- publishing {
- publications {
- mavenJava(MavenPublication) {
- from components.java
- artifact sourcesJar
- artifact javadocJar
- artifact testsJar
- pom {
- name = 'Smack'
- packaging = 'jar'
- inceptionYear = '2003'
- url = 'http://www.igniterealtime.org/projects/smack/'
- description = project.description
-
- issueManagement {
- system = 'JIRA'
- url = 'https://igniterealtime.org/issues/browse/SMACK'
- }
-
- scm {
- url = 'https://github.com/igniterealtime/Smack'
- connection = 'scm:git:https://github.com/igniterealtime/Smack.git'
- developerConnection = 'scm:git:https://github.com/igniterealtime/Smack.git'
- }
-
- developers {
- developer {
- id = 'flow'
- name = 'Florian Schmaus'
- email = 'flow@igniterealtime.org'
- }
- }
- }
- }
- }
- repositories {
- if (sonatypeCredentialsAvailable && useSonatype) {
- maven {
- url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
- credentials {
- username = sonatypeUsername
- password = sonatypePassword
- }
- }
- }
- // Use
- // gradle publish -P customRepoUrl=https://www.igniterealtime.org/archiva/repository/maven -P customRepoUsername=bamboo -P customRepoPassword=hidden -P useSonatype=false
- // to deploy to this repo.
- if (project.hasProperty("customRepoUrl")) {
- maven {
- name 'customRepo'
- url customRepoUrl
- if (project.hasProperty("customRepoUsername")) {
- credentials {
- username customRepoUsername
- password customRepoPassword
- }
- }
- }
- }
- }
- }
- rootProject.distributionZip {
- dependsOn build
- from(buildDir) {
- include "$libsDirName/*${version}.jar"
- include "$libsDirName/*${version}-javadoc.jar"
- include "$libsDirName/*${version}-sources.jar"
- }
- }
-
- // Workaround for gpg signatory not supporting the 'required' option
- // See https://github.com/gradle/gradle/issues/5064#issuecomment-381924984
- // Note what we use 'signing.gnupg.keyName' instead of 'signing.keyId'.
- tasks.withType(Sign) {
- onlyIf {
- project.hasProperty('signing.gnupg.keyName')
- }
- }
- signing {
- useGpgCmd()
- required { signingRequired }
- sign publishing.publications.mavenJava
- }
-
- // Work around https://github.com/gradle/gradle/issues/4046
- task copyJavadocDocFiles(type: Copy) {
- from('src/javadoc')
- into 'build/docs/javadoc'
- include '**/doc-files/*.*'
- }
- javadoc.dependsOn copyJavadocDocFiles
-
- // Make sure root projects 'javadocAll' depends on the
- // subproject's javadoc, to ensure that all all doc-files/ are
- // generated and up-to-date. Obviously this means that the
- // javadocAll task will also create the individual javadoc's of the
- // subprojects.
- javadocAll.dependsOn javadoc
-}
-
-// The smack-java8-full project generates the dot and png files of the
-// current state graph. Ensure they are generated before copied.
-configure (project(':smack-java8-full')) {
- copyJavadocDocFiles.dependsOn convertModularXmppClientToServerConnectionStateGraphDotToPng
-}
-
-configure (androidProjects + androidBootClasspathProjects) {
- apply plugin: 'ru.vyarus.animalsniffer'
- dependencies {
- signature "net.sf.androidscents.signature:android-api-level-${smackMinAndroidSdk}:5.0.1_r2@signature"
- }
- animalsniffer {
- sourceSets = [sourceSets.main]
- }
-}
-
-subprojects*.jar {
- manifest {
- from sharedManifest
- }
- bundle {
- bnd(
- '-removeheaders': 'Tool, Bnd-*',
- '-exportcontents': '*',
- )
- }
-}
-
-configure(subprojects - gplLicensedProjects) {
- checkstyle {
- configProperties.checkstyleLicenseHeader = "header"
- }
- publishing {
- publications {
- mavenJava(MavenPublication) {
- pom {
- licenses {
- license {
- name = 'The Apache Software License, Version 2.0'
- url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution = 'repo'
- }
- }
- }
- }
- }
- }
-}
-
-configure(gplLicensedProjects) {
- checkstyle {
- configProperties.checkstyleLicenseHeader = "${project.name}-gplv3-license-header"
- }
- publishing {
- publications {
- mavenJava(MavenPublication) {
- pom {
- licenses {
- license {
- name = 'GNU General Public License, version 3 or any later version'
- url = 'https://www.gnu.org/licenses/gpl.txt'
- distribution = 'repo'
- }
- }
- }
- }
- }
- }
-}
-
-configure(androidBootClasspathProjects) {
- compileJava {
- options.bootstrapClasspath = files(androidBootClasspath)
- }
- javadoc {
- classpath += files(androidBootClasspath)
- }
-}
-
-apply plugin: "com.github.kt3k.coveralls"
-coveralls {
- sourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs).files.absolutePath
-}
-
-task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
- dependsOn = projectsWithUnitTests.jacocoTestReport
- getSourceDirectories().setFrom(files(projectsWithUnitTests.sourceSets.main.allSource.srcDirs))
- getClassDirectories().setFrom(files(projectsWithUnitTests.sourceSets.main.output))
- getExecutionData().setFrom(files(projectsWithUnitTests.jacocoTestReport.executionData))
- reports {
- xml.enabled true
- xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
- }
- // We could remove the following setOnlyIf line, but then
- // jacocoRootReport would silently be SKIPPED if something with
- // the projectsWithUnitTests is wrong (e.g. a project is missing
- // in there).
- setOnlyIf { true }
-}
-
task integrationTest {
description 'Verify correct functionality of Smack by running some integration tests.'
dependsOn project(':smack-integration-test').tasks.run
@@ -676,7 +70,7 @@ task integrationTest {
task omemoSignalIntTest {
description 'Run integration tests of the smack-omemo module in combination with smack-omemo-signal.'
- dependsOn project(':smack-omemo-signal-integration-test').tasks.run
+ dependsOn 'smack-omemo-signal-integration-test:run'
}
task sinttestAll {
@@ -687,70 +81,6 @@ task sinttestAll {
]}
}
-def getGitCommit() {
- def projectDirFile = new File("$projectDir")
- def dotGit = new File(projectDirFile, ".git")
- if (!dotGit.isDirectory()) return 'non-git build'
-
- def cmd = 'git describe --always --tags --dirty=+'
- def proc = cmd.execute(null, projectDirFile)
- proc.waitForOrKill(10 * 1000)
-
- def gitCommit = proc.text.trim()
- assert !gitCommit.isEmpty()
-
- def srCmd = 'git symbolic-ref --short HEAD'
- def srProc = srCmd.execute(null, projectDirFile)
- srProc.waitForOrKill(10 * 1000)
- if (srProc.exitValue() == 0) {
- // Only add the information if the git command was
- // successful. There may be no symbolic reference for HEAD if
- // e.g. in detached mode.
- def symbolicReference = srProc.text.trim()
- assert !symbolicReference.isEmpty()
- gitCommit += "-$symbolicReference"
- }
-
- gitCommit
-}
-
-def getAndroidRuntimeJar() {
- def androidApiLevel = ext.smackMinAndroidSdk
- def androidHome = getAndroidHome()
- def androidJar = new File("$androidHome/platforms/android-${androidApiLevel}/android.jar")
- if (androidJar.isFile()) {
- return androidJar
- } else {
- throw new Exception("Can't find android.jar for API level ${androidApiLevel}. Please install corresponding SDK platform package")
- }
-}
-
-def getAndroidJavadocOffline() {
- def androidHome = getAndroidHome()
- return androidHome.toString() + "/docs/reference"
-}
-
-def getAndroidHome() {
- def androidHomeEnv = System.getenv("ANDROID_HOME")
- if (androidHomeEnv == null) {
- throw new Exception("ANDROID_HOME environment variable is not set")
- }
- def androidHome = new File(androidHomeEnv)
- if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
- return androidHome
-}
-
-def readVersionFile() {
- def versionFile = new File(rootDir, 'version')
- if (!versionFile.isFile()) {
- throw new Exception("Could not find version file")
- }
- if (versionFile.text.isEmpty()) {
- throw new Exception("Version file does not contain a version")
- }
- versionFile.text.trim()
-}
-
def getResolvedVersion(queriedProject = 'smack-core', component) {
def configuration = project(queriedProject)
.configurations
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index e708b1c023ec8b20f512888fe07c5bd3ff77bb8f..a4b76b9530d66f5e68d973ea569d8e19de379189 100644
GIT binary patch
literal 43583
zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA
z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P
z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or
zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`;
zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf
zR2h?lbDZQ`p9P;&DQ4F0sur@TMa!Y}S8irn(%d-gi0*WxxCSk*A?3lGh=gcYN?FGl
z7D=Js!i~0=u3rox^eO3i@$0=n{K1lPNU
zwmfjRVmLOCRfe=seV&P*1Iq=^i`502keY8Uy-WNPwVNNtJFx?IwAyRPZo2Wo1+S(xF37LJZ~%i)kpFQ3Fw=mXfd@>%+)RpYQLnr}B~~zoof(JVm^^&f
zxKV^+3D3$A1G;qh4gPVjhrC8e(VYUHv#dy^)(RoUFM?o%W-EHxufuWf(l*@-l+7vt
z=l`qmR56K~F|v<^Pd*p~1_y^P0P^aPC##d8+HqX4IR1gu+7w#~TBFphJxF)T$2WEa
zxa?H&6=Qe7d(#tha?_1uQys2KtHQ{)Qco)qwGjrdNL7thd^G5i8Os)CHqc>iOidS}
z%nFEDdm=GXBw=yXe1W-ShHHFb?Cc70+$W~z_+}nAoHFYI1MV1wZegw*0y^tC*s%3h
zhD3tN8b=Gv&rj}!SUM6|ajSPp*58KR7MPpI{oAJCtY~JECm)*m_x>AZEu>DFgUcby
z1Qaw8lU4jZpQ_$;*7RME+gq1KySGG#Wql>aL~k9tLrSO()LWn*q&YxHEuzmwd1?aAtI
zBJ>P=&$=l1efe1CDU;`Fd+_;&wI07?V0aAIgc(!{a
z0Jg6Y=inXc3^n!U0Atk`iCFIQooHqcWhO(qrieUOW8X(x?(RD}iYDLMjSwffH2~tB
z)oDgNBLB^AJBM1M^c5HdRx6fBfka`(LD-qrlh5jqH~);#nw|iyp)()xVYak3;Ybik
z0j`(+69aK*B>)e_p%=wu8XC&9e{AO4c~O1U`5X9}?0mrd*m$_EUek{R?DNSh(=br#
z#Q61gBzEpmy`$pA*6!87
zSDD+=@fTY7<4A?GLqpA?Pb2z$pbCc4B4zL{BeZ?F-8`s$?>*lXXtn*NC61>|*w7J*
z$?!iB{6R-0=KFmyp1nnEmLsA-H0a6l+1uaH^g%c(p{iT&YFrbQ$&PRb8Up#X3@Zsk
zD^^&LK~111%cqlP%!_gFNa^dTYT?rhkGl}5=fL{a`UViaXWI$k-UcHJwmaH1s=S$4
z%4)PdWJX;hh5UoK?6aWoyLxX&NhNRqKam7tcOkLh{%j3K^4Mgx1@i|Pi&}<^5>hs5
zm8?uOS>%)NzT(%PjVPGa?X%`N2TQCKbeH2l;cTnHiHppPSJ<7y-yEIiC!P*ikl&!B
z%+?>VttCOQM@ShFguHVjxX^?mHX^hSaO_;pnyh^v9EumqSZTi+#f&_Vaija0Q-e*|
z7ulQj6Fs*bbmsWp{`auM04gGwsYYdNNZcg|ph0OgD>7O}Asn7^Z=eI>`$2*v78;sj-}oMoEj&@)9+ycEOo92xSyY344^
z11Hb8^kdOvbf^GNAK++bYioknrpdN>+u8R?JxG=!2Kd9r=YWCOJYXYuM0cOq^FhEd
zBg2puKy__7VT3-r*dG4c62Wgxi52EMCQ`bKgf*#*ou(D4-ZN$+mg&7$u!!
z-^+Z%;-3IDwqZ|K=ah85OLwkO
zKxNBh+4QHh)u9D?MFtpbl)us}9+V!D%w9jfAMYEb>%$A;u)rrI
zuBudh;5PN}_6J_}l55P3l_)&RMlH{m!)ai-i$g)&*M`eN$XQMw{v^r@-125^RRCF0
z^2>|DxhQw(mtNEI2Kj(;KblC7x=JlK$@78`O~>V!`|1Lm-^JR$-5pUANAnb(5}B}JGjBsliK4&
zk6y(;$e&h)lh2)L=bvZKbvh@>vLlreBdH8No2>$#%_Wp1U0N7Ank!6$dFSi#xzh|(
zRi{Uw%-4W!{IXZ)fWx@XX6;&(m_F%c6~X8hx=BN1&q}*(
zoaNjWabE{oUPb!Bt$eyd#$5j9rItB-h*5JiNi(v^e|XKAj*8(k<5-2$&ZBR5fF|JA
z9&m4fbzNQnAU}r8ab>fFV%J0z5awe#UZ|bz?Ur)U9bCIKWEzi2%A+5CLqh?}K4JHi
z4vtM;+uPsVz{Lfr;78W78gC;z*yTch~4YkLr&m-7%-xc
ztw6Mh2d>_iO*$Rd8(-Cr1_V8EO1f*^@wRoSozS)
zy1UoC@pruAaC8Z_7~_w4Q6n*&B0AjOmMWa;sIav&gu
z|J5&|{=a@vR!~k-OjKEgPFCzcJ>#A1uL&7xTDn;{XBdeM}V=l3B8fE1--DHjSaxoSjNKEM9|U9#m2<3>n{Iuo`r3UZp;>GkT2YBNAh|b
z^jTq-hJp(ebZh#Lk8hVBP%qXwv-@vbvoREX$TqRGTgEi$%_F9tZES@z8Bx}$#5eeG
zk^UsLBH{bc2VBW)*EdS({yw=?qmevwi?BL6*=12k9zM5gJv1>y#ML4!)iiPzVaH9%
zgSImetD@dam~e>{LvVh!phhzpW+iFvWpGT#CVE5TQ40n%F|p(sP5mXxna+Ev7PDwA
zamaV4m*^~*xV+&p;W749xhb_X=$|LD;FHuB&JL5?*Y2-oIT(wYY2;73<^#46S~Gx|
z^cez%V7x$81}UWqS13Gz80379Rj;6~WdiXWOSsdmzY39L;Hg3MH43o*y8ibNBBH`(av4|u;YPq%{R;IuYow<+GEsf@R?=@tT@!}?#>zIIn0CoyV!hq3mw
zHj>OOjfJM3F{RG#6ujzo?y32m^tgSXf@v=J$ELdJ+=5j|=F-~hP$G&}tDZsZE?5rX
ztGj`!S>)CFmdkccxM9eGIcGnS2AfK#gXwj%esuIBNJQP1WV~b~+D7PJTmWGTSDrR`
zEAu4B8l>NPuhsk5a`rReSya2nfV1EK01+G!x8aBdTs3Io$u5!6n6KX%uv@DxAp3F@{4UYg4SWJtQ-W~0MDb|j-$lwVn
znAm*Pl!?Ps&3wO=R115RWKb*JKoexo*)uhhHBncEDMSVa_PyA>k{Zm2(wMQ(5NM3#
z)jkza|GoWEQo4^s*wE(gHz?Xsg4`}HUAcs42cM1-qq_=+=!Gk^y710j=66(cSWqUe
zklbm8+zB_syQv5A2rj!Vbw8;|$@C!vfNmNV!yJIWDQ>{+2x
zKjuFX`~~HKG~^6h5FntRpnnHt=D&rq0>IJ9#F0eM)Y-)GpRjiN7gkA8wvnG#K=q{q
z9dBn8_~wm4J<3J_vl|9H{7q6u2A!cW{bp#r*-f{gOV^e=8S{nc1DxMHFwuM$;aVI^
zz6A*}m8N-&x8;aunp1w7_vtB*pa+OYBw=TMc6QK=mbA-|Cf*
zvyh8D4LRJImooUaSb7t*fVfih<97Gf@VE0|z>NcBwBQze);Rh!k3K_sfunToZY;f2
z^HmC4KjHRVg+eKYj;PRN^|E0>Gj_zagfRbrki68I^#~6-HaHg3BUW%+clM1xQEdPYt_g<2K+z!$>*$9nQ>;
zf9Bei{?zY^-e{q_*|W#2rJG`2fy@{%6u0i_VEWTq$*(ZN37|8lFFFt)nCG({r!q#9
z5VK_kkSJ3?zOH)OezMT{!YkCuSSn!K#-Rhl$uUM(bq*jY?
zi1xbMVthJ`E>d>(f3)~fozjg^@eheMF6<)I`oeJYx4*+M&%c9VArn(OM-wp%M<-`x
z7sLP1&3^%Nld9Dhm@$3f2}87!quhI@nwd@3~fZl_3LYW-B?Ia>ui`ELg
z&Qfe!7m6ze=mZ`Ia9$z|ARSw|IdMpooY4YiPN8K
z4B(ts3p%2i(Td=tgEHX
z0UQ_>URBtG+-?0E;E7Ld^dyZ;jjw0}XZ(}-QzC6+NN=40oDb2^v!L1g9xRvE#@IBR
zO!b-2N7wVfLV;mhEaXQ9XAU+>=XVA6f&T4Z-@AX!leJ8obP^P^wP0aICND?~w&NykJ#54x3_@r7IDMdRNy4Hh;h*!u(Ol(#0bJdwEo$5437-UBjQ+j=Ic>Q2z`
zJNDf0yO6@mr6y1#n3)s(W|$iE_i8r@Gd@!DWDqZ7J&~gAm1#~maIGJ1sls^gxL9LLG_NhU!pTGty!TbhzQnu)I*S^54U6Yu%ZeCg`R>Q
zhBv$n5j~h)Y%y=zErI?{tl!(JWSDXxco7X8WI-6K;9Z-h&~kIv?$!60v%O_j{QYWG!R9W?5_b&67KB$t}&e2LdMvd(PxN6Ir!H4>PNlerpBL>Zvyy!yw
z-SOo8caEpDt(}|gKPBd$qND5#a5nju^O>V&;f890?yEOfkSG^HQVmEbM3Ugzu+UtH
zC(INPDdraBN?P%kE;*Ae%Wto&sgw(crfZ#Qy(<4nk;S|hD3j{IQRI6Yq|f^basLY;
z-HB&Je%Gg}Jt@={_C{L$!RM;$$|iD6vu#3w?v?*;&()uB|I-XqEKqZPS!reW9JkLewLb!70T7n`i!gNtb1%vN-
zySZj{8-1>6E%H&=V}LM#xmt`J3XQoaD|@XygXjdZ1+P77-=;=eYpoEQ01B@L*a(uW
zrZeZz?HJsw_4g0vhUgkg@VF8<-X$B8pOqCuWAl28uB|@r`19DTUQQsb^pfqB6QtiT
z*`_UZ`fT}vtUY#%sq2{rchyfu*pCg;uec2$-$N_xgjZcoumE5vSI{+s@iLWoz^Mf;
zuI8kDP{!XY6OP~q5}%1&L}CtfH^N<3o4L@J@zg1-mt{9L`s^z$Vgb|mr{@WiwAqKg
zp#t-lhrU>F8o0s1q_9y`gQNf~Vb!F%70f}$>i7o4ho$`uciNf=xgJ>&!gSt0g;M>*x4-`U)ysFW&Vs^Vk6m%?iuWU+o&m(2Jm26Y(3%TL;
zA7T)BP{WS!&xmxNw%J=$MPfn(9*^*TV;$JwRy8Zl*yUZi8jWYF>==j~&S|Xinsb%c
z2?B+kpet*muEW7@AzjBA^wAJBY8i|#C{WtO_or&Nj2{=6JTTX05}|H>N2B|Wf!*3_
z7hW*j6p3TvpghEc6-wufFiY!%-GvOx*bZrhZu+7?iSrZL5q9}igiF^*R3%DE4aCHZ
zqu>xS8LkW+Auv%z-<1Xs92u23R$nk@Pk}MU5!gT|c7vGlEA%G^2th&Q*zfg%-D^=f
z&J_}jskj|Q;73NP4<4k*Y%pXPU2Thoqr+5uH1yEYM|VtBPW6lXaetokD0u
z9qVek6Q&wk)tFbQ8(^HGf3Wp16gKmr>G;#G(HRBx?F`9AIRboK+;OfHaLJ(P>IP0w
zyTbTkx_THEOs%Q&aPrxbZrJlio+hCC_HK<4%f3ZoSAyG7Dn`=X=&h@m*|UYO-4Hq0
z-Bq&+Ie!S##4A6OGoC~>ZW`Y5J)*ouaFl_e9GA*VSL!O_@xGiBw!AF}1{tB)z(w%c
zS1Hmrb9OC8>0a_$BzeiN?rkPLc9%&;1CZW*4}CDDNr2gcl_3z+WC15&H1Zc2{o~i)
z)LLW=WQ{?ricmC`G1GfJ0Yp4Dy~Ba;j6ZV4r{8xRs`13{dD!xXmr^Aga|C=iSmor%
z8hi|pTXH)5Yf&v~exp3o+sY4B^^b*eYkkCYl*T{*=-0HniSA_1F53eCb{x~1k3*`W
zr~};p1A`k{1DV9=UPnLDgz{aJH=-LQo<5%+Em!DNN252xwIf*wF_zS^!(XSm(9eoj
z=*dXG&n0>)_)N5oc6v!>-bd(2ragD8O=M|wGW
z!xJQS<)u70m&6OmrF0WSsr@I%T*c#Qo#Ha4d3COcX+9}hM5!7JIGF>7<~C(Ear^Sn
zm^ZFkV6~Ula6+8S?oOROOA6$C&q&dp`>oR-2Ym3(HT@O7Sd5c~+kjrmM)YmgPH*tL
zX+znN>`tv;5eOfX?h{AuX^LK~V#gPCu=)Tigtq9&?7Xh$qN|%A$?V*v=&-2F$zTUv
z`C#WyIrChS5|Kgm_GeudCFf;)!WH7FI60j^0o#65o6`w*S7R@)88n$1nrgU(oU0M9
zx+EuMkC>(4j1;m6NoGqEkpJYJ?vc|B
zOlwT3t&UgL!pX_P*6g36`ZXQ;
z9~Cv}ANFnJGp(;ZhS(@FT;3e)0)Kp;h^x;$*xZn*k0U6-&FwI=uOGaODdrsp-!K$Ac32^c{+FhI-HkYd5v=`PGsg%6I`4d9Jy)uW0y%)
zm&j^9WBAp*P8#kGJUhB!L?a%h$hJgQrx!6KCB_TRo%9{t0J7KW8!o1B!NC)VGLM5!
zpZy5Jc{`r{1e(jd%jsG7k%I+m#CGS*BPA65ZVW~fLYw0dA-H_}O
zrkGFL&P1PG9p2(%QiEWm6x;U-U&I#;Em$nx-_I^wtgw3xUPVVu
zqSuKnx&dIT-XT+T10p;yjo1Y)z(x1fb8Dzfn8e yu?e%!_ptzGB|8GrCfu%p?(_
zQccdaaVK$5bz;*rnyK{_SQYM>;aES6Qs^lj9lEs6_J+%nIiuQC*fN;z8md>r_~Mfl
zU%p5Dt_YT>gQqfr@`cR!$NWr~+`CZb%dn;WtzrAOI>P_JtsB76PYe*<%H(y>qx-`Kq!X_;
z<{RpAqYhE=L1r*M)gNF3B8r(<%8mo*SR2hu
zccLRZwGARt)Hlo1euqTyM>^!HK*!Q2P;4UYrysje@;(<|$&%vQekbn|0Ruu_Io(w4#%p6ld2Yp7tlA`Y$cciThP
zKzNGIMPXX%&Ud0uQh!uQZz|FB`4KGD?3!ND?wQt6!n*f4EmCoJUh&b?;B{|lxs#F-
z31~HQ`SF4x$&v00@(P+j1pAaj5!s`)b2RDBp*PB=2IB>oBF!*6vwr7Dp%zpAx*dPr
zb@Zjq^XjN?O4QcZ*O+8>)|HlrR>oD*?WQl5ri3R#2?*W6iJ>>kH%KnnME&TT@ZzrHS$Q%LC?n|e>V+D+8D
zYc4)QddFz7I8#}y#Wj6>4P%34dZH~OUDb?uP%-E
zwjXM(?Sg~1!|wI(RVuxbu)-rH+O=igSho_pDCw(c6b=P
zKk4ATlB?bj9+HHlh<_!&z0rx13K3ZrAR8W)!@Y}o`?a*JJsD+twZIv`W)@Y?Amu_u
zz``@-e2X}27$i(2=9rvIu5uTUOVhzwu%mNazS|lZb&PT;XE2|B&W1>=B58#*!~D&)
zfVmJGg8UdP*fx(>Cj^?yS^zH#o-$Q-*$SnK(ZVFkw+er=>N^7!)FtP3y~Xxnu^nzY
zikgB>Nj0%;WOltWIob|}%lo?_C7<``a5hEkx&1ku$|)i>Rh6@3h*`slY=9U}(Ql_<
zaNG*J8vb&@zpdhAvv`?{=zDedJ23TD&Zg__snRAH4eh~^oawdYi6A3w8<Ozh@Kw)#bdktM^GVb
zrG08?0bG?|NG+w^&JvD*7LAbjED{_Zkc`3H!My>0u5Q}m!+6VokMLXxl`Mkd=g&Xx
z-a>m*#G3SLlhbKB!)tnzfWOBV;u;ftU}S!NdD5+YtOjLg?X}dl>7m^gOpihrf1;PY
zvll&>dIuUGs{Qnd-
zwIR3oIrct8Va^Tm0t#(bJD7c$Z7DO9*7NnRZorrSm`b`cxz>OIC;jSE3DO8`hX955ui`s%||YQtt2
z5DNA&pG-V+4oI2s*x^>-$6J?p=I>C|9wZF8z;VjR??Icg?1w2v5Me+FgAeGGa8(3S
z4vg*$>zC-WIVZtJ7}o9{D-7d>zCe|z#<9>CFve-OPAYsneTb^JH!Enaza#j}^mXy1
z+ULn^10+rWLF6j2>Ya@@Kq?26>AqK{A_|
zQKb*~F1>sE*=d?A?W7N2j?L09_7n+HGi{VY;MoTGr_)G9)ot$p!-UY5zZ2Xtbm=t
z@dpPSGwgH=QtIcEulQNI>S-#ifbnO5EWkI;$A|pxJd885oM+
zGZ0_0gDvG8q2xebj+fbCHYfAXuZStH2j~|d^sBAzo46(K8n59+T6rzBwK)^rfPT+B
zyIFw)9YC-V^rhtK`!3jrhmW-sTmM+tPH+;nwjL#-SjQPUZ53L@A>y*rt(#M(qsiB2
zx6B)dI}6Wlsw%bJ8h|(lhkJVogQZA&n{?Vgs6gNSXzuZpEyu*xySy8ro07QZ7Vk1!3tJphN_5V7qOiyK8p
z#@jcDD8nmtYi1^l8ml;AF<#IPK?!pqf9D4moYk>d99Im}Jtwj6c#+A;f)CQ*f-hZ<
z=p_T86jog%!p)D&5g9taSwYi&eP
z#JuEK%+NULWus;0w32-SYFku#i}d~+{Pkho&^{;RxzP&0!RCm3-9K6`>KZpnzS6?L
z^H^V*s!8<>x8bomvD%rh>Zp3>Db%kyin;qtl+jAv8Oo~1g~mqGAC&Qi_wy|xEt2iz
zWAJEfTV%cl2Cs<1L&DLRVVH05EDq`pH7Oh7sR`NNkL%wi}8n>IXcO40hp+J+sC!W?!krJf!GJNE8uj
zg-y~Ns-<~D?yqbzVRB}G>0A^f0!^N7l=$m0OdZuqAOQqLc
zX?AEGr1Ht+inZ-Qiwnl@Z0qukd__a!C*CKuGdy5#nD7VUBM^6OCpxCa2A(X;e0&V4
zM&WR8+wErQ7UIc6LY~Q9x%Sn*Tn>>P`^t&idaOEnOd(Ufw#>NoR^1QdhJ8s`h^|R_
zXX`c5*O~Xdvh%q;7L!_!ohf$NfEBmCde|#uVZvEo>OfEq%+Ns7&_f$OR9xsihRpBb
z+cjk8LyDm@U{YN>+r46?nn{7Gh(;WhFw6GAxtcKD+YWV?uge>;+q#Xx4!GpRkVZYu
zzsF}1)7$?%s9g9CH=Zs+B%M_)+~*j3L0&Q9u7!|+T`^O{xE6qvAP?XWv9_MrZKdo&
z%IyU)$Q95AB4!#hT!_dA>4e@zjOBD*Y=XjtMm)V|+IXzjuM;(l+8aA5#Kaz_$rR6!
zj>#&^DidYD$nUY(D$mH`9eb|dtV0b{S>H6FBfq>t5`;OxA4Nn{J(+XihF(stSche7$es&~N$epi&PDM_N`As;*9D^L==2Q7Z2zD+CiU(|+-kL*VG+&9!Yb3LgPy?A
zm7Z&^qRG_JIxK7-FBzZI3Q<;{`DIxtc48k>
zc|0dmX;Z=W$+)qE)~`yn6MdoJ4co;%!`ddy+FV538Y)j(vg}5*k(WK)KWZ3WaOG!8
z!syGn=s{H$odtpqFrT#JGM*utN7B((abXnpDM6w56nhw}OY}0TiTG1#f*VFZr+^-g
zbP10`$LPq_;PvrA1XXlyx2uM^mrjTzX}w{yuLo-cOClE8MMk47T25G8M!9Z5ypOSV
zAJUBGEg5L2fY)ZGJb^E34R2zJ?}Vf>{~gB!8=5Z)
z9y$>5c)=;o0HeHHSuE4U)#vG&KF|I%-cF6f$~pdYJWk_dD}iOA>iA$O$+4%@>JU08
zS`ep)$XLPJ+n0_i@PkF#ri6T8?ZeAot$6JIYHm&P6EB=BiaNY|aA$W0I+nz*zkz_z
zkEru!tj!QUffq%)8y0y`T&`fuus-1p>=^hnBiBqD^hXrPs`PY9tU3m0np~rISY09>
z`P3s=-kt_cYcxWd{de@}TwSqg*xVhp;E9zCsnXo6z
z?f&Sv^U7n4`xr=mXle94HzOdN!2kB~4=%)u&N!+2;z6UYKUDqi-s6AZ!haB;@&B`?
z_TRX0%@suz^TRdCb?!vNJYPY8L_}&07uySH9%W^Tc&1pia6y1q#?*Drf}GjGbPjBS
zbOPcUY#*$3sL2x4v_i*Y=N7E$mR}J%|GUI(>WEr+28+V
z%v5{#e!UF*6~G&%;l*q*$V?&r$Pp^sE^i-0$+RH3ERUUdQ0>rAq2(2QAbG}$y{de(
z>{qD~GGuOk559Y@%$?N^1ApVL_a704>8OD%8Y%8B;FCt%AoPu8*D1
zLB5X>b}Syz81pn;xnB}%0FnwazlWfUV)Z-~rZg6~b
z6!9J$EcE&sEbzcy?CI~=boWA&eeIa%z(7SE^qgVLz??1Vbc1*aRvc%Mri)AJaAG!p
z$X!_9Ds;Zz)f+;%s&dRcJt2==P{^j3bf0M=nJd&xwUGlUFn?H=2W(*2I2Gdu
zv!gYCwM10aeus)`RIZSrCK=&oKaO_Ry~D1B5!y0R=%!i2*KfXGYX&gNv_u+n9wiR5
z*e$Zjju&ODRW3phN925%S(jL+bCHv6rZtc?!*`1TyYXT6%Ju=|X;6D@lq$8T
zW{Y|e39ioPez(pBH%k)HzFITXHvnD6hw^lIoUMA;qAJ^CU?top1fo@s7xT13Fvn1H
z6JWa-6+FJF#x>~+A;D~;VDs26>^oH0EI`IYT2iagy23?nyJ==i{g4%HrAf1-*v
zK1)~@&(KkwR7TL}L(A@C_S0G;-GMDy=MJn2$FP5s<%wC)4jC5PXoxrQBFZ_k0P{{s@sz+gX`-!=T8rcB(=7vW}^K6oLWMmp(rwDh}b
zwaGGd>yEy6fHv%jM$yJXo5oMAQ>c9j`**}F?MCry;T@47@r?&sKHgVe$MCqk#Z_3S
z1GZI~nOEN*P~+UaFGnj{{Jo@16`(qVNtbU>O0Hf57-P>x8Jikp=`s8xWs^dAJ9lCQ
z)GFm+=OV%AMVqVATtN@|vp61VVAHRn87}%PC^RAzJ%JngmZTasWBAWsoAqBU+8L8u
z4A&Pe?fmTm0?mK-BL9t+{y7o(7jm+RpOhL9KnY#E&qu^}B6=K_dB}*VlSEiC9fn)+V=J;OnN)Ta5v66ic1rG+dGAJ1
z1%Zb_+!$=tQ~lxQrzv3x#CPb?CekEkA}0MYSgx$Jdd}q8+R=ma$|&1a#)TQ=l$1tQ
z=tL9&_^vJ)Pk}EDO-va`UCT1m#Uty1{v^A3P~83_#v^ozH}6*9mIjIr;t3Uv%@VeW
zGL6(CwCUp)Jq%G0bIG%?{_*Y#5IHf*5M@wPo6A{$Um++Co$wLC=J1aoG93&T7Ho}P
z=mGEPP7GbvoG!uD$k(H3A$Z))+i{Hy?QHdk>3xSBXR0j!11O^mEe9RHmw!pvzv?Ua~2_l2Yh~_!s1qS`|0~0)YsbHSz8!mG)WiJE|
z2f($6TQtt6L_f~ApQYQKSb=`053LgrQq7G@98#igV>y#i==-nEjQ!XNu9
z~;mE+gtj4IDDNQJ~JVk5Ux6&LCSFL!y=>79kE9=V}J7tD==Ga+IW
zX)r7>VZ9dY=V&}DR))xUoV!u(Z|%3ciQi_2jl}3=$Agc(`RPb
z8kEBpvY>1FGQ9W$n>Cq=DIpski};nE)`p3IUw1Oz0|wxll^)4dq3;CCY@RyJgFgc#
zKouFh!`?Xuo{IMz^xi-h=StCis_M7y