Examples of PubSub


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

        Assert.assertNotNull(pubSub);
    }

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

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

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

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

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

                "      <subscription node='node6' jid='francisco@denmark.lit' subscription='subscribed' subid='004-yyy'/>\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(), 5);
        Assert.assertEquals(pubSub.getSubscriptions().get(0).getNode(), "node1");
        Assert.assertEquals(pubSub.getSubscriptions().get(0).getJid(), Jid.valueOf("francisco@denmark.lit"));
        Assert.assertEquals(pubSub.getSubscriptions().get(0).getSubscriptionState(), SubscriptionState.SUBSCRIBED);

        Assert.assertEquals(pubSub.getSubscriptions().get(2).getSubscriptionState(), SubscriptionState.UNCONFIGURED);
        Assert.assertEquals(pubSub.getSubscriptions().get(3).getSubId(), "123-abc");
    }
View Full Code Here

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

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

        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

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

        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

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

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

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

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

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

        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

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

        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
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.