Examples of PubSubOwner


Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

                "      <redirect uri='xmpp:hamlet@denmark.lit?;node=blog'/>\n" +
                "    </delete>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSubOwner pubSubOwner = iq.getExtension(PubSubOwner.class);
        Assert.assertNotNull(pubSubOwner);
        Assert.assertTrue(pubSubOwner.isDelete());
        Assert.assertEquals(pubSubOwner.getNode(), "princely_musings");
        Assert.assertEquals(pubSubOwner.getRedirectUri(), URI.create("xmpp:hamlet@denmark.lit?;node=blog"));
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

                "  <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>\n" +
                "    <purge node='princely_musings'/>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSubOwner pubSubOwner = iq.getExtension(PubSubOwner.class);
        Assert.assertNotNull(pubSubOwner);
        Assert.assertTrue(pubSubOwner.isPurge());
        Assert.assertEquals(pubSubOwner.getNode(), "princely_musings");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

                "      <affiliation jid='polonius@denmark.lit' affiliation='outcast'/>\n" +
                "    </affiliations>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSubOwner pubSubOwner = iq.getExtension(PubSubOwner.class);
        Assert.assertNotNull(pubSubOwner);
        Assert.assertNotNull(pubSubOwner.getAffiliations());
        Assert.assertEquals(pubSubOwner.getNode(), "princely_musings");
        Assert.assertEquals(pubSubOwner.getAffiliations().size(), 2);
        Assert.assertEquals(pubSubOwner.getAffiliations().get(0).getJid(), Jid.valueOf("hamlet@denmark.lit"));
        Assert.assertEquals(pubSubOwner.getAffiliations().get(0).getAffiliationState(), AffiliationState.OWNER);

        Assert.assertEquals(pubSubOwner.getAffiliations().get(1).getJid(), Jid.valueOf("polonius@denmark.lit"));
        Assert.assertEquals(pubSubOwner.getAffiliations().get(1).getAffiliationState(), AffiliationState.OUTCAST);
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

        Assert.assertEquals(pubSubOwner.getAffiliations().get(1).getAffiliationState(), AffiliationState.OUTCAST);
    }

    @Test
    public void marshalPubSubOwnerDelete() throws JAXBException, XMLStreamException {
        PubSubOwner pubSubOwner = PubSubOwner.withDelete("test");
        String xml = marshal(pubSubOwner);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub#owner\"><delete node=\"test\"></delete></pubsub>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0060.html#owner-default">8.3 Request Default Node Configuration Options</a>
     */
    private DataForm getDefaultNodeConfiguration() throws XmppException {
        IQ result = xmppSession.query(new IQ(service, IQ.Type.GET, PubSubOwner.withDefault()));
        PubSubOwner pubSubOwner = result.getExtension(PubSubOwner.class);
        return pubSubOwner.getConfigurationForm();
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

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

    @Test
    public void marshalDeleteNode() throws JAXBException, XMLStreamException {
        PubSubOwner pubSub = PubSubOwner.withDelete("princely_musings");
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub#owner\"><delete node=\"princely_musings\"></delete></pubsub>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

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

    @Test
    public void marshalDeleteNodeWithRedirect() throws JAXBException, XMLStreamException {
        PubSubOwner pubSub = PubSubOwner.withDelete("princely_musings", URI.create("xmpp:hamlet@denmark.lit?;node=blog"));
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub#owner\"><delete node=\"princely_musings\"><redirect uri=\"xmpp:hamlet@denmark.lit?;node=blog\"></redirect></delete></pubsub>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub#owner\"><delete node=\"princely_musings\"><redirect uri=\"xmpp:hamlet@denmark.lit?;node=blog\"></redirect></delete></pubsub>");
    }

    @Test
    public void marshalPurgeNodes() throws JAXBException, XMLStreamException {
        PubSubOwner pubSub = PubSubOwner.withPurge("princely_musings");
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub#owner\"><purge node=\"princely_musings\"></purge></pubsub>");
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

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

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

Examples of rocks.xmpp.extensions.pubsub.model.owner.PubSubOwner

                "    </subscriptions>\n" +
                "  </pubsub>\n" +
                "</iq>\n";

        IQ iq = unmarshal(xml, IQ.class);
        PubSubOwner pubSubOwner = iq.getExtension(PubSubOwner.class);
        Assert.assertNotNull(pubSubOwner);
        Assert.assertTrue(pubSubOwner.isSubscriptions());
        Assert.assertEquals(pubSubOwner.getNode(), "princely_musings");
        Assert.assertEquals(pubSubOwner.getSubscriptions().size(), 4);
    }
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.