Package rocks.xmpp.extensions.muc.model.user

Examples of rocks.xmpp.extensions.muc.model.user.MucUser


                "    </invite>\n" +
                "    <password>cauldronburn</password>\n" +
                "  </x>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        MucUser mucUser = message.getExtension(MucUser.class);
        Assert.assertNotNull(mucUser);
        Assert.assertNotNull(mucUser.getInvites());
        Assert.assertEquals(mucUser.getInvites().get(0).getTo(), Jid.valueOf("hecate@shakespeare.lit"));
        Assert.assertEquals(mucUser.getInvites().get(0).getReason(), "Hey Hecate, this is the place for all good witches!");
        Assert.assertEquals(mucUser.getPassword(), "cauldronburn");
    }
View Full Code Here


                "      <reason>Sorry, I'm too busy right now.</reason>\n" +
                "    </decline>\n" +
                "  </x>\n" +
                "</message>\n";
        Message message = unmarshal(xml, Message.class);
        MucUser mucUser = message.getExtension(MucUser.class);
        Assert.assertNotNull(mucUser);
        Assert.assertNotNull(mucUser.getDecline());
        Assert.assertEquals(mucUser.getDecline().getTo(), Jid.valueOf("crone1@shakespeare.lit"));
        Assert.assertEquals(mucUser.getDecline().getReason(), "Sorry, I'm too busy right now.");
    }
View Full Code Here

                "      <continue thread='e0ffe42b28561960c6b12b944a092794b9683a38'/>\n" +
                "    </invite>\n" +
                "  </x>\n" +
                "</message>";
        Message message = unmarshal(xml, Message.class);
        MucUser mucUser = message.getExtension(MucUser.class);
        Assert.assertNotNull(mucUser);
        Assert.assertNotNull(mucUser.getInvites());
        Assert.assertEquals(mucUser.getInvites().size(), 2);
        Assert.assertEquals(mucUser.getInvites().get(0).getTo(), Jid.valueOf("wiccarocks@shakespeare.lit/laptop"));
        Assert.assertEquals(mucUser.getInvites().get(0).getThread(), "e0ffe42b28561960c6b12b944a092794b9683a38");
        Assert.assertTrue(mucUser.getInvites().get(0).isContinue());
        Assert.assertEquals(mucUser.getInvites().get(1).getTo(), Jid.valueOf("hag66@shakespeare.lit"));
        Assert.assertEquals(mucUser.getInvites().get(1).getThread(), "e0ffe42b28561960c6b12b944a092794b9683a38");
    }
View Full Code Here

                "    </item>\n" +
                "    <status code='307'/>\n" +
                "  </x>\n" +
                "</presence>";
        Presence presence = unmarshal(xml, Presence.class);
        MucUser mucUser = presence.getExtension(MucUser.class);
        Assert.assertNotNull(mucUser);
        Assert.assertNotNull(mucUser.getItem());
        Assert.assertNotNull(mucUser.getItem().getActor());
        Assert.assertEquals(mucUser.getItem().getActor().getNick(), "Fluellen");
    }
View Full Code Here

                "      <reason>Macbeth doth come.</reason>\n" +
                "    </destroy>\n" +
                "  </x>\n" +
                "</presence>\n";
        Presence presence = unmarshal(xml, Presence.class);
        MucUser mucUser = presence.getExtension(MucUser.class);
        Assert.assertNotNull(mucUser);
        Assert.assertNotNull(mucUser.getDestroy());
        Assert.assertEquals(mucUser.getDestroy().getJid(), Jid.valueOf("coven@chat.shakespeare.lit"));
        Assert.assertEquals(mucUser.getDestroy().getReason(), "Macbeth doth come.");
    }
View Full Code Here

        Assert.assertEquals(mucUser.getDestroy().getReason(), "Macbeth doth come.");
    }

    @Test
    public void marshalDestroyRoom() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withDestroy(Affiliation.NONE, Role.NONE, Jid.valueOf("coven@chat.shakespeare.lit"), "Macbeth doth come.");
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getDestroy().getReason(), "Macbeth doth come.");
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" role=\"none\"></item><destroy jid=\"coven@chat.shakespeare.lit\"><reason>Macbeth doth come.</reason></destroy></x>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" role=\"none\"></item><destroy jid=\"coven@chat.shakespeare.lit\"><reason>Macbeth doth come.</reason></destroy></x>");
    }

    @Test
    public void marshalWithItem() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withItem(Affiliation.NONE, Role.NONE, Jid.valueOf("coven@chat.shakespeare.lit"), "Nick");
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getItem().getNick(), "Nick");
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" jid=\"coven@chat.shakespeare.lit\" nick=\"Nick\" role=\"none\"></item></x>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><item affiliation=\"none\" jid=\"coven@chat.shakespeare.lit\" nick=\"Nick\" role=\"none\"></item></x>");
    }

    @Test
    public void marshalWithInvites() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withInvites(new Invite(Jid.valueOf("coven@chat.shakespeare.lit"), "reason"));
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getInvites().size(), 1);
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><invite to=\"coven@chat.shakespeare.lit\"><reason>reason</reason></invite></x>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><invite to=\"coven@chat.shakespeare.lit\"><reason>reason</reason></invite></x>");
    }

    @Test
    public void marshalWithStatus() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withStatus(Status.affiliationChanged());
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getStatusCodes().size(), 1);
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><status code=\"101\"></status></x>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><status code=\"101\"></status></x>");
    }

    @Test
    public void marshalWithDecline() throws JAXBException, XMLStreamException {
        MucUser mucUser = MucUser.withDecline(Jid.valueOf("coven@chat.shakespeare.lit"), "reason");
        String xml = marshal(mucUser);
        Assert.assertEquals(mucUser.getDecline().getReason(), "reason");
        Assert.assertEquals(xml, "<x xmlns=\"http://jabber.org/protocol/muc#user\"><decline to=\"coven@chat.shakespeare.lit\"><reason>reason</reason></decline></x>");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.muc.model.user.MucUser

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.