Package rocks.xmpp.extensions.pubsub.model

Examples of rocks.xmpp.extensions.pubsub.model.PubSub


                "  <pubsub xmlns='http://jabber.org/protocol/pubsub'>\n" +
                "    <subscriptions/>\n" +
                "  </pubsub>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getSubscriptions());
        Assert.assertEquals(pubSub.getSubscriptions().size(), 0);
    }
View Full Code Here


        Assert.assertEquals(pubSub.getSubscriptions().size(), 0);
    }

    @Test
    public void marshalAffiliations() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withAffiliations();
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><affiliations></affiliations></pubsub>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><affiliations></affiliations></pubsub>");
    }

    @Test
    public void marshalAffiliationsWithNode() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withAffiliations("node6");
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><affiliations node=\"node6\"></affiliations></pubsub>");
    }
View Full Code Here

                "      <affiliation node='node6' affiliation='owner'/>\n" +
                "    </affiliations>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getAffiliations());
        Assert.assertEquals(pubSub.getAffiliations().size(), 4);
        Assert.assertEquals(pubSub.getAffiliations().get(0).getNode(), "node1");
        Assert.assertEquals(pubSub.getAffiliations().get(0).getAffiliationState(), AffiliationState.OWNER);

        Assert.assertEquals(pubSub.getAffiliations().get(1).getAffiliationState(), AffiliationState.PUBLISHER);
        Assert.assertEquals(pubSub.getAffiliations().get(2).getAffiliationState(), AffiliationState.OUTCAST);
    }
View Full Code Here

                "  <pubsub xmlns='http://jabber.org/protocol/pubsub'>\n" +
                "    <affiliations/>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getAffiliations());
        Assert.assertTrue(pubSub.getAffiliations().isEmpty());
    }
View Full Code Here

        super(IQ.class, PubSub.class, PubSubOwner.class);
    }

    @Test
    public void marshalCreate() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withCreate("princely_musings");
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><create node=\"princely_musings\"></create></pubsub>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><create node=\"princely_musings\"></create></pubsub>");
    }

    @Test
    public void marshalCreateInstantNode() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withCreate(null);
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><create></create></pubsub>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><create></create></pubsub>");
    }

    @Test
    public void marshalConfigure() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withConfigure("princely_musings", null);
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><configure node=\"princely_musings\"></configure></pubsub>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><configure node=\"princely_musings\"></configure></pubsub>");
    }

    @Test
    public void marshalDefault() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withDefault();
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><default></default></pubsub>");
    }
View Full Code Here

                "      <item id='ae890ac52d0df67ed7cfdf51b644e901'/>\n" +
                "    </publish>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getPublish());
        Assert.assertEquals(pubSub.getPublish().getNode(), "princely_musings");
        Assert.assertNotNull(pubSub.getPublish().getItem());
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.pubsub.model.PubSub

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.