Package rocks.xmpp.extensions.data.model

Examples of rocks.xmpp.extensions.data.model.DataForm.findField()


        Assert.assertEquals(fieldAdministrators.getValues().get(0), "test1@domain");
        Assert.assertEquals(fieldAdministrators.getValues().get(1), "test2@domain");
        Assert.assertEquals(roomInfoForm.getContacts(), Arrays.asList(Jid.valueOf("test1@domain"), Jid.valueOf("test2@domain")));

        roomInfoForm.setDescription("Description");
        DataForm.Field fieldDescription = dataForm.findField("muc#roominfo_description");
        Assert.assertNotNull(fieldDescription);
        Assert.assertEquals(fieldDescription.getValues().size(), 1);
        Assert.assertEquals(fieldDescription.getValues().get(0), "Description");
        Assert.assertEquals(roomInfoForm.getDescription(), "Description");
View Full Code Here


        Assert.assertEquals(fieldDescription.getValues().size(), 1);
        Assert.assertEquals(fieldDescription.getValues().get(0), "Description");
        Assert.assertEquals(roomInfoForm.getDescription(), "Description");

        roomInfoForm.setLanguage("en");
        DataForm.Field fieldLanguage = dataForm.findField("muc#roominfo_lang");
        Assert.assertNotNull(fieldLanguage);
        Assert.assertEquals(fieldLanguage.getValues().size(), 1);
        Assert.assertEquals(fieldLanguage.getValues().get(0), "en");
        Assert.assertEquals(roomInfoForm.getLanguage(), "en");
View Full Code Here

        Assert.assertEquals(fieldLanguage.getValues().size(), 1);
        Assert.assertEquals(fieldLanguage.getValues().get(0), "en");
        Assert.assertEquals(roomInfoForm.getLanguage(), "en");

        roomInfoForm.setLdapGroup("ldap");
        DataForm.Field fieldLdap = dataForm.findField("muc#roominfo_ldapgroup");
        Assert.assertNotNull(fieldLdap);
        Assert.assertEquals(fieldLdap.getValues().size(), 1);
        Assert.assertEquals(fieldLdap.getValues().get(0), "ldap");
        Assert.assertEquals(roomInfoForm.getLdapGroup(), "ldap");
View Full Code Here

        Assert.assertEquals(fieldLdap.getValues().size(), 1);
        Assert.assertEquals(fieldLdap.getValues().get(0), "ldap");
        Assert.assertEquals(roomInfoForm.getLdapGroup(), "ldap");

        roomInfoForm.setLogs(new URL("http://www.example.net"));
        DataForm.Field fieldLogs = dataForm.findField("muc#roominfo_logs");
        Assert.assertNotNull(fieldLogs);
        Assert.assertEquals(fieldLogs.getValues().size(), 1);
        Assert.assertEquals(fieldLogs.getValues().get(0), "http://www.example.net");
        Assert.assertEquals(roomInfoForm.getLogs(), new URL("http://www.example.net"));
View Full Code Here

        Assert.assertEquals(fieldLogs.getValues().size(), 1);
        Assert.assertEquals(fieldLogs.getValues().get(0), "http://www.example.net");
        Assert.assertEquals(roomInfoForm.getLogs(), new URL("http://www.example.net"));

        roomInfoForm.setCurrentNumberOfOccupants(4);
        DataForm.Field fieldOccupants = dataForm.findField("muc#roominfo_occupants");
        Assert.assertNotNull(fieldOccupants);
        Assert.assertEquals(fieldOccupants.getValues().size(), 1);
        Assert.assertEquals(fieldOccupants.getValues().get(0), "4");
        Assert.assertEquals(roomInfoForm.getCurrentNumberOfOccupants(), 4);
View Full Code Here

        Assert.assertEquals(fieldOccupants.getValues().size(), 1);
        Assert.assertEquals(fieldOccupants.getValues().get(0), "4");
        Assert.assertEquals(roomInfoForm.getCurrentNumberOfOccupants(), 4);

        roomInfoForm.setSubject("test");
        DataForm.Field fieldSubject = dataForm.findField("muc#roominfo_subject");
        Assert.assertNotNull(fieldSubject);
        Assert.assertEquals(fieldSubject.getValues().size(), 1);
        Assert.assertEquals(fieldSubject.getValues().get(0), "test");
        Assert.assertEquals(roomInfoForm.getSubject(), "test");
View Full Code Here

        Assert.assertEquals(fieldSubject.getValues().size(), 1);
        Assert.assertEquals(fieldSubject.getValues().get(0), "test");
        Assert.assertEquals(roomInfoForm.getSubject(), "test");

        roomInfoForm.setChangeSubjectAllowed(true);
        DataForm.Field fieldMembersOnly = dataForm.findField("muc#roominfo_subjectmod");
        Assert.assertNotNull(fieldMembersOnly);
        Assert.assertEquals(fieldMembersOnly.getValues().size(), 1);
        Assert.assertEquals(fieldMembersOnly.getValues().get(0), "1");
        Assert.assertTrue(roomInfoForm.isChangeSubjectAllowed());
    }
View Full Code Here

                        // Assume no valid streams by default, unless valid streams are found.
                        boolean noValidStreams = true;
                        if (featureNegotiation != null) {
                            DataForm dataForm = featureNegotiation.getDataForm();
                            if (dataForm != null) {
                                DataForm.Field field = dataForm.findField(STREAM_METHOD);
                                if (field != null) {
                                    List<String> streamMethods = new ArrayList<>();
                                    for (DataForm.Option option : field.getOptions()) {
                                        streamMethods.add(option.getValue());
                                    }
View Full Code Here

    public void testEmptyDataForm() throws MalformedURLException {
        DataForm dataForm = new DataForm(DataForm.Type.SUBMIT);

        RequestVoiceForm requestVoiceForm = new RequestVoiceForm(dataForm);
        requestVoiceForm.setJid(Jid.valueOf("hag66@shakespeare.lit/pda"));
        DataForm.Field fieldJid = dataForm.findField("muc#jid");
        Assert.assertNotNull(fieldJid);
        Assert.assertEquals(fieldJid.getValues().size(), 1);
        Assert.assertEquals(fieldJid.getValues().get(0), "hag66@shakespeare.lit/pda");
        Assert.assertEquals(requestVoiceForm.getJid(), Jid.valueOf("hag66@shakespeare.lit/pda"));
View Full Code Here

        Assert.assertEquals(fieldJid.getValues().size(), 1);
        Assert.assertEquals(fieldJid.getValues().get(0), "hag66@shakespeare.lit/pda");
        Assert.assertEquals(requestVoiceForm.getJid(), Jid.valueOf("hag66@shakespeare.lit/pda"));

        requestVoiceForm.setRoomNick("thirdwitch");
        DataForm.Field fieldRoomNick = dataForm.findField("muc#roomnick");
        Assert.assertNotNull(fieldRoomNick);
        Assert.assertEquals(fieldRoomNick.getValues().size(), 1);
        Assert.assertEquals(fieldRoomNick.getValues().get(0), "thirdwitch");
        Assert.assertEquals(requestVoiceForm.getRoomNick(), "thirdwitch");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.