Package rocks.xmpp.extensions.pubsub.model

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


                "        subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'\n" +
                "        subscription='subscribed'/>\n" +
                "  </pubsub>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getSubscription());
        Assert.assertEquals(pubSub.getSubscription().getNode(), "princely_musings");
        Assert.assertEquals(pubSub.getSubscription().getJid(), Jid.valueOf("francisco@denmark.lit"));
        Assert.assertEquals(pubSub.getSubscription().getSubId(), "ba49252aaa4f5d320c24d3766f0bdcade78c78d3");
        Assert.assertEquals(pubSub.getSubscription().getSubscriptionState(), SubscriptionState.SUBSCRIBED);
    }
View Full Code Here


                "        jid='francisco@denmark.lit'\n" +
                "        subscription='pending'/>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getSubscription());
        Assert.assertEquals(pubSub.getSubscription().getSubscriptionState(), SubscriptionState.PENDING);
    }
View Full Code Here

                "      </subscribe-options>\n" +
                "    </subscription>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getSubscription());
        Assert.assertTrue(pubSub.getSubscription().isConfigurationRequired());
    }
View Full Code Here

                "      <subscribe-options/>\n" +
                "    </subscription>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getSubscription());
        Assert.assertFalse(pubSub.getSubscription().isConfigurationRequired());
    }
View Full Code Here

    // TODO Example 48. Service returns error specifying that subscription configuration is required

    @Test
    public void marshalUnsubscribe() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withUnsubscribe("node6", Jid.valueOf("francisco@denmark.lit"), null);
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><unsubscribe jid=\"francisco@denmark.lit\" node=\"node6\"></unsubscribe></pubsub>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><unsubscribe jid=\"francisco@denmark.lit\" node=\"node6\"></unsubscribe></pubsub>");
    }

    @Test
    public void marshalRequestOptions() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withOptions("node6", Jid.valueOf("francisco@denmark.lit"));
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><options node=\"node6\" jid=\"francisco@denmark.lit\"></options></pubsub>");
    }
View Full Code Here

    }

    // TODO  Example 68. Subscriber submits completed options form
    @Test
    public void marshalSubmitOptions() throws JAXBException, XMLStreamException {
        PubSub pubSub = PubSub.withOptions("node6", Jid.valueOf("francisco@denmark.lit"));
        String xml = marshal(pubSub);
        Assert.assertEquals(xml, "<pubsub xmlns=\"http://jabber.org/protocol/pubsub\"><options node=\"node6\" jid=\"francisco@denmark.lit\"></options></pubsub>");
    }
View Full Code Here

                "      </x>\n" +
                "    </options>\n" +
                "  </pubsub>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        PubSub pubSub = iq.getExtension(PubSub.class);
        Assert.assertNotNull(pubSub);
        Assert.assertNotNull(pubSub.getOptions());
        Assert.assertNotNull(pubSub.getOptions().getDataForm());
    }
View Full Code Here

        Assert.assertNotNull(pubSub.getOptions().getDataForm());
    }

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

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

    @Test
    public void marshalDefaultAllNodes() 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

TOP

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

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.