Package rocks.xmpp.extensions.data.model

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


        Assert.assertEquals(fieldRoomNick.getValues().size(), 1);
        Assert.assertEquals(fieldRoomNick.getValues().get(0), "thirdwitch");
        Assert.assertEquals(requestVoiceForm.getRoomNick(), "thirdwitch");

        requestVoiceForm.setRole(Role.PARTICIPANT);
        DataForm.Field fieldRole = dataForm.findField("muc#role");
        Assert.assertNotNull(fieldRole);
        Assert.assertEquals(fieldRole.getValues().size(), 1);
        Assert.assertEquals(fieldRole.getValues().get(0), "participant");
        Assert.assertEquals(requestVoiceForm.getRole(), Role.PARTICIPANT);
View Full Code Here


        Assert.assertEquals(fieldRole.getValues().size(), 1);
        Assert.assertEquals(fieldRole.getValues().get(0), "participant");
        Assert.assertEquals(requestVoiceForm.getRole(), Role.PARTICIPANT);

        requestVoiceForm.setRequestAllowed(true);
        DataForm.Field fieldAllow = dataForm.findField("muc#request_allow");
        Assert.assertNotNull(fieldAllow);
        Assert.assertEquals(fieldAllow.getValues().size(), 1);
        Assert.assertEquals(fieldAllow.getValues().get(0), "1");
        Assert.assertTrue(requestVoiceForm.isRequestAllowed());
    }
View Full Code Here

    @Test
    public void testEmptyDataForm() {
        DataForm dataForm = new DataForm(DataForm.Type.SUBMIT);
        RoomConfigurationForm roomConfigurationForm = new RoomConfigurationForm(dataForm);
        roomConfigurationForm.setMaxHistoryMessages(50);
        DataForm.Field fieldHistoryFetch = dataForm.findField("muc#maxhistoryfetch");
        Assert.assertNotNull(fieldHistoryFetch);
        Assert.assertEquals(fieldHistoryFetch.getValues().size(), 1);
        Assert.assertEquals(fieldHistoryFetch.getValues().get(0), "50");
        Assert.assertEquals(roomConfigurationForm.getMaxHistoryMessages(), 50);
View Full Code Here

        Assert.assertEquals(fieldHistoryFetch.getValues().size(), 1);
        Assert.assertEquals(fieldHistoryFetch.getValues().get(0), "50");
        Assert.assertEquals(roomConfigurationForm.getMaxHistoryMessages(), 50);

        roomConfigurationForm.setAllowedRolesToSendPrivateMessages(EnumSet.of(Role.MODERATOR, Role.PARTICIPANT));
        DataForm.Field fieldAllowPM = dataForm.findField("muc#roomconfig_allowpm");
        Assert.assertNotNull(fieldAllowPM);
        Assert.assertEquals(fieldAllowPM.getValues().size(), 1);
        Assert.assertEquals(fieldAllowPM.getValues().get(0), "anyone");
        Assert.assertEquals(roomConfigurationForm.getAllowedRolesToSendPrivateMessages(), EnumSet.of(Role.MODERATOR, Role.PARTICIPANT));
View Full Code Here

        Assert.assertEquals(fieldAllowPM.getValues().size(), 1);
        Assert.assertEquals(fieldAllowPM.getValues().get(0), "anyone");
        Assert.assertEquals(roomConfigurationForm.getAllowedRolesToSendPrivateMessages(), EnumSet.of(Role.MODERATOR, Role.PARTICIPANT));

        roomConfigurationForm.setAllowInvites(true);
        DataForm.Field fieldAllowInvites = dataForm.findField("muc#roomconfig_allowinvites");
        Assert.assertNotNull(fieldAllowInvites);
        Assert.assertEquals(fieldAllowInvites.getValues().size(), 1);
        Assert.assertEquals(fieldAllowInvites.getValues().get(0), "1");
        Assert.assertTrue(roomConfigurationForm.isAllowInvites());
View Full Code Here

        Assert.assertEquals(fieldAllowInvites.getValues().size(), 1);
        Assert.assertEquals(fieldAllowInvites.getValues().get(0), "1");
        Assert.assertTrue(roomConfigurationForm.isAllowInvites());

        roomConfigurationForm.setChangeSubjectAllowed(true);
        DataForm.Field fieldAllowChangeSubject = dataForm.findField("muc#roomconfig_changesubject");
        Assert.assertNotNull(fieldAllowChangeSubject);
        Assert.assertEquals(fieldAllowChangeSubject.getValues().size(), 1);
        Assert.assertEquals(fieldAllowChangeSubject.getValues().get(0), "1");
        Assert.assertTrue(roomConfigurationForm.isAllowInvites());
View Full Code Here

        Assert.assertEquals(fieldAllowChangeSubject.getValues().size(), 1);
        Assert.assertEquals(fieldAllowChangeSubject.getValues().get(0), "1");
        Assert.assertTrue(roomConfigurationForm.isAllowInvites());

        roomConfigurationForm.setPublicLoggingEnabled(true);
        DataForm.Field fieldEnableLogging = dataForm.findField("muc#roomconfig_enablelogging");
        Assert.assertNotNull(fieldEnableLogging);
        Assert.assertEquals(fieldEnableLogging.getValues().size(), 1);
        Assert.assertEquals(fieldEnableLogging.getValues().get(0), "1");
        Assert.assertTrue(roomConfigurationForm.isAllowInvites());
View Full Code Here

        Assert.assertEquals(fieldEnableLogging.getValues().size(), 1);
        Assert.assertEquals(fieldEnableLogging.getValues().get(0), "1");
        Assert.assertTrue(roomConfigurationForm.isAllowInvites());

        roomConfigurationForm.setRolesWhichMayRetrieveMemberList(EnumSet.of(Role.MODERATOR, Role.PARTICIPANT));
        DataForm.Field fieldGetMemberList = dataForm.findField("muc#roomconfig_getmemberlist");
        Assert.assertNotNull(fieldGetMemberList);
        Assert.assertEquals(fieldGetMemberList.getValues().size(), 2);
        Assert.assertEquals(fieldGetMemberList.getValues().get(0), "moderator");
        Assert.assertEquals(fieldGetMemberList.getValues().get(1), "participant");
        Assert.assertEquals(roomConfigurationForm.getRolesWhichMayRetrieveMemberList(), EnumSet.of(Role.MODERATOR, Role.PARTICIPANT));
View Full Code Here

        Assert.assertEquals(fieldGetMemberList.getValues().get(0), "moderator");
        Assert.assertEquals(fieldGetMemberList.getValues().get(1), "participant");
        Assert.assertEquals(roomConfigurationForm.getRolesWhichMayRetrieveMemberList(), EnumSet.of(Role.MODERATOR, Role.PARTICIPANT));

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

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

        roomConfigurationForm.setPubSubNode(URI.create("http://test"));
        DataForm.Field fieldPubsub = dataForm.findField("muc#roomconfig_pubsub");
        Assert.assertNotNull(fieldPubsub);
        Assert.assertEquals(fieldPubsub.getValues().size(), 1);
        Assert.assertEquals(fieldPubsub.getValues().get(0), "http://test");
        Assert.assertEquals(roomConfigurationForm.getPubSubNode(), URI.create("http://test"));
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.