Package rocks.xmpp.extensions.muc.model

Examples of rocks.xmpp.extensions.muc.model.RequestVoiceForm


                "    </field>\n" +
                "  </x>\n";

        DataForm dataForm = unmarshal(xml, DataForm.class);

        RequestVoiceForm requestVoiceForm = new RequestVoiceForm(dataForm);

        Assert.assertEquals(requestVoiceForm.getRoomNick(), "thirdwitch");
        Assert.assertEquals(requestVoiceForm.getRole(), Role.PARTICIPANT);
        Assert.assertEquals(requestVoiceForm.getJid(), Jid.valueOf("hag66@shakespeare.lit/pda"));
        Assert.assertTrue(requestVoiceForm.isRequestAllowed());
    }
View Full Code Here


    @Test
    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"));

        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");

        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);

        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

TOP

Related Classes of rocks.xmpp.extensions.muc.model.RequestVoiceForm

Copyright © 2018 www.massapicom. 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.