commit 2b5e13ca4683ecd513fb31029c90d34107a8dc3c parent e3c27710d946bb3bbfbdb2c0f4b6fd5dedc8a666 Author: Daniel Gultsch <daniel@gultsch.de> Date: Wed, 28 Feb 2018 15:20:21 +0100 Merge branch 'inbandreg' of https://github.com/RishiRaj22/ComplianceTester into RishiRaj22-inbandreg Diffstat:
A | src/main/java/eu/siacs/compliance/tests/InBandRegistrationTest.java | | | 35 | +++++++++++++++++++++++++++++++++++ |
1 file changed, 35 insertions(+), 0 deletions(-)
diff --git a/src/main/java/eu/siacs/compliance/tests/InBandRegistrationTest.java b/src/main/java/eu/siacs/compliance/tests/InBandRegistrationTest.java @@ -0,0 +1,34 @@ +package eu.siacs.compliance.tests; + +import eu.siacs.compliance.Result; +import rocks.xmpp.core.XmppException; +import rocks.xmpp.core.session.XmppClient; +import rocks.xmpp.extensions.register.RegistrationManager; + +public class InBandRegistrationTest extends AbstractTest { + + public InBandRegistrationTest(XmppClient client) { + super(client); + } + + @Override + public Result run() { + String domain = client.getConnectedResource().getDomain(); + XmppClient testClient = XmppClient.create(domain); + RegistrationManager registrationManager = testClient.getManager(RegistrationManager.class); + try { + if(registrationManager.isRegistrationSupported().getResult()) { + return Result.PASSED; + } + return Result.FAILED; + } catch (XmppException e) { + e.printStackTrace(); + return Result.FAILED; + } + } + + @Override + public String getName() { + return "XEP-0077: In-Band Registration"; + } +} +\ No newline at end of file