Package org.apache.vysper.xmpp.stanza

Examples of org.apache.vysper.xmpp.stanza.Stanza


    public void testRetrieveAffiliationsNoSuchNode() throws Exception {
        String testNode = "test";
        assertNull(root.find(testNode));

        AbstractStanzaGenerator sg = new DefaultRetrieveAffiliationsStanzaGenerator("test");
        Stanza stanza = sg.getStanza(client, pubsubService, "id123", testNode);
        ResponseStanzaContainer result = sendStanza(stanza, true);
        assertTrue(result.hasResponse());
        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.ERROR.value(),response.getType());
View Full Code Here


    }

    public void testRetrieveAffiliations() {
        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

        return new DefaultSubscribeStanzaGenerator();
    }

    public void testNoSubscriptions() {
        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService, "id123", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);
       
        assertTrue(result.hasResponse());
       
        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

        n1.subscribe("id123", client);
        n1.subscribe("id124", client);
        n2.subscribe("id125", client);
        n3.subscribe("id126", client);
       
        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);
       
        assertTrue(result.hasResponse());
       
        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

        n1.subscribe("id123", client);
        n1.subscribe("id124", client);
        n2.subscribe("id125", client);
        n3.subscribe("id126", client);
       
        Stanza stanza = sg.getStanza(client, pubsubService, "4711", "Node1");
        ResponseStanzaContainer result = sendStanza(stanza, true);
       
        assertTrue(result.hasResponse());
       
        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

    public void testModifyAffiliationsNoAuth() {
        Entity client2 = new EntityImpl("yoda", "starwars.com", null);

        AbstractStanzaGenerator sg = new DefaultModifyAffiliationsStanzaGenerator("Node1", client, PubSubAffiliation.MEMBER);
        Stanza stanza = sg.getStanza(client2, pubsubService, "id123", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

    public void testModifyAffiliationsNoSuchNode() throws Exception {
        String testNode = "test";
        assertNull(root.find(testNode));

        AbstractStanzaGenerator sg = new DefaultModifyAffiliationsStanzaGenerator("test", client, PubSubAffiliation.MEMBER);
        Stanza stanza = sg.getStanza(client, pubsubService, "id123", testNode);
        ResponseStanzaContainer result = sendStanza(stanza, true);
        assertTrue(result.hasResponse());
        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.ERROR.value(),response.getType());
View Full Code Here

        assertEquals(PubSubAffiliation.MEMBER, n1.getAffiliation(client2));
        assertEquals(PubSubAffiliation.NONE, n1.getAffiliation(client3));

        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

        assertEquals(PubSubAffiliation.MEMBER, n1.getAffiliation(client2));
        assertEquals(PubSubAffiliation.NONE, n1.getAffiliation(client3));

        DefaultModifyAffiliationsStanzaGenerator sg = new DefaultModifyAffiliationsStanzaGenerator(n1.getName(), client2, PubSubAffiliation.NONE);

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

        assertEquals(PubSubAffiliation.MEMBER, n1.getAffiliation(client2));
        assertEquals(PubSubAffiliation.NONE, n1.getAffiliation(client3));

        DefaultModifyAffiliationsStanzaGenerator sg = new DefaultModifyAffiliationsStanzaGenerator(n1.getName(), client, PubSubAffiliation.NONE);

        Stanza stanza = sg.getStanza(client, pubsubService, "4711", null);
        ResponseStanzaContainer result = sendStanza(stanza, true);

        assertTrue(result.hasResponse());

        IQStanza response = new IQStanza(result.getResponseStanza());
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.stanza.Stanza

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.