commit 00039aa5257197de3c1e9a92b149be2d7b2a5db1 parent 2b5e13ca4683ecd513fb31029c90d34107a8dc3c Author: Daniel Gultsch <daniel@gultsch.de> Date: Wed, 28 Feb 2018 15:44:19 +0100 XEP-0077: made sure registration form can actually be retrieved Diffstat:
M | src/main/java/eu/siacs/compliance/tests/InBandRegistrationTest.java | | | 14 | +++++++++----- |
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/main/java/eu/siacs/compliance/tests/InBandRegistrationTest.java b/src/main/java/eu/siacs/compliance/tests/InBandRegistrationTest.java @@ -4,6 +4,9 @@ import eu.siacs.compliance.Result; import rocks.xmpp.core.XmppException; import rocks.xmpp.core.session.XmppClient; import rocks.xmpp.extensions.register.RegistrationManager; +import rocks.xmpp.extensions.register.model.Registration; + +import java.util.concurrent.ExecutionException; public class InBandRegistrationTest extends AbstractTest { @@ -13,16 +16,17 @@ public class InBandRegistrationTest extends AbstractTest { @Override public Result run() { - String domain = client.getConnectedResource().getDomain(); - XmppClient testClient = XmppClient.create(domain); - RegistrationManager registrationManager = testClient.getManager(RegistrationManager.class); + final String domain = client.getConnectedResource().getDomain(); + final XmppClient testClient = XmppClient.create(domain); try { + testClient.connect(); + RegistrationManager registrationManager = testClient.getManager(RegistrationManager.class); if(registrationManager.isRegistrationSupported().getResult()) { + registrationManager.getRegistration().get(); return Result.PASSED; } return Result.FAILED; - } catch (XmppException e) { - e.printStackTrace(); + } catch (Exception e) { return Result.FAILED; } }