From 37c024ec9aa3b65ce2a5195b8a9d06d1e11c6aed Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Fri, 29 Sep 2023 20:16:59 +0200 Subject: [PATCH 1/2] [sinttest] When using IBR, do not attempt to login The Smack Integration Tests use In-Band Registration when no admin account credentials are provided. As a consequence, SINT should not try to use those credentials when using IBR. --- .../smack/inttest/XmppConnectionManager.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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 e74bced82c..9dae78eb55 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 @@ -184,20 +184,18 @@ public static boolean removeConnectionDescriptor(String nickname) { switch (sinttestConfiguration.accountRegistration) { case serviceAdministration: - case inBandRegistration: accountRegistrationConnection = defaultConnectionDescriptor.construct(sinttestConfiguration); accountRegistrationConnection.connect(); accountRegistrationConnection.login(sinttestConfiguration.adminAccountUsername, sinttestConfiguration.adminAccountPassword); - - if (sinttestConfiguration.accountRegistration == AccountRegistration.inBandRegistration) { - - adminManager = null; - accountManager = AccountManager.getInstance(accountRegistrationConnection); - } else { - adminManager = ServiceAdministrationManager.getInstanceFor(accountRegistrationConnection); - accountManager = null; - } + adminManager = ServiceAdministrationManager.getInstanceFor(accountRegistrationConnection); + accountManager = null; + break; + case inBandRegistration: + accountRegistrationConnection = defaultConnectionDescriptor.construct(sinttestConfiguration); + accountRegistrationConnection.connect(); + adminManager = null; + accountManager = AccountManager.getInstance(accountRegistrationConnection); break; case disabled: accountRegistrationConnection = null; From efa71caadfaf565a7ddde434a5ac1e7f3b11e581 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Fri, 29 Sep 2023 20:21:14 +0200 Subject: [PATCH 2/2] [sinttest] Fix typos in log and exception messages --- .../igniterealtime/smack/inttest/XmppConnectionManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 9dae78eb55..714ed89e85 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 @@ -285,7 +285,7 @@ void disconnectAndCleanup() throws InterruptedException { if (unsuccessfullyDeletedAccountsCount == 0) { LOGGER.info("Successfully deleted all created accounts ✔"); } else { - LOGGER.warning("Could not delete all created accounts, " + unsuccessfullyDeletedAccountsCount + " remainaing"); + LOGGER.warning("Could not delete all created accounts, " + unsuccessfullyDeletedAccountsCount + " remaining"); } } @@ -364,11 +364,11 @@ private void registerAccount(String username, String password) throws NoResponse break; case inBandRegistration: if (!accountManager.supportsAccountCreation()) { - throw new UnsupportedOperationException("Account creation/registation is not supported"); + throw new UnsupportedOperationException("Account creation/registration is not supported"); } Set requiredAttributes = accountManager.getAccountAttributes(); if (requiredAttributes.size() > 4) { - throw new IllegalStateException("Unkown required attributes"); + throw new IllegalStateException("Unknown required attributes"); } Map additionalAttributes = new HashMap<>(); additionalAttributes.put("name", "Smack Integration Test");