Package org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.model

Examples of org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.model.LeafNode


        // since we have no nodes, there should be no items.
        assertEquals(0, inner.size());
    }
   
    public void testSomeItems() throws Exception {
        root.add(new LeafNode(serviceConfiguration, "news", "News", client));
        root.add(new LeafNode(serviceConfiguration, "blogs", "Blogs", client));
       
        DefaultDiscoInfoStanzaGenerator sg = (DefaultDiscoInfoStanzaGenerator)getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService.getBareJID(), "id123");

        ResponseStanzaContainer result = sendStanza(stanza, true);
View Full Code Here


        assertNotNull(news);
        assertNotNull(blogs);
    }
   
    public void testNodeItemsNone() throws Exception {
        root.add(new LeafNode(serviceConfiguration, "news", "News", client));
       
        DefaultDiscoInfoStanzaGenerator sg = (DefaultDiscoInfoStanzaGenerator)getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService.getBareJID(), "id123", "news");

        ResponseStanzaContainer result = sendStanza(stanza, true);
View Full Code Here

        // since we have no messages, there should be no items.
        assertEquals(0, inner.size());
    }
   
    public void testNodeItemsSome() throws Exception {
        LeafNode node = new LeafNode(serviceConfiguration, "news", "News", client);
        root.add(node);
       
        XMLElement item1 = new XMLElement("namespace1", "item1", null,(Attribute[])null, (XMLFragment[])null);
        XMLElement item2 = new XMLElement("namespace2", "item2", null,(Attribute[])null, (XMLFragment[])null);
        XMLElement item3 = new XMLElement("namespace3", "item3", null,(Attribute[])null, (XMLFragment[])null);
        node.publish(client, relay, "itemid1", item1);
        Thread.sleep(10);
        node.publish(client, relay, "itemid2", item1); // publish this one with the same id as the next one (overwritten by the next)
        node.publish(client, relay, "itemid2", item2); // overwrite the prev. item (use the same itemid)
        Thread.sleep(10);
        node.publish(client, relay, "itemid3", item3);
       
       
        DefaultDiscoInfoStanzaGenerator sg = (DefaultDiscoInfoStanzaGenerator)getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService.getBareJID(), "id123", "news");
View Full Code Here

        IQStanza response = new IQStanza(result.getResponseStanza());
        assertEquals(IQStanzaType.RESULT.value(),response.getType());

        assertEquals("id123", response.getAttributeValue("id")); // IDs must match
       
        LeafNode n = root.find(testNode);
        assertEquals(testNode, n.getName());
    }
View Full Code Here

        assertEquals(testNode, n.getName());
    }
   
    public void testCreateDuplicate() throws Exception {
        String testNode = "test";
        root.add(new LeafNode(serviceConfiguration, testNode, client));
        assertNotNull(root.find(testNode)); // should be there
       
        AbstractStanzaGenerator sg = getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService, "id123", testNode);
        ResponseStanzaContainer result = sendStanza(stanza, true);
View Full Code Here

    protected LeafNode node = null;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        node = new LeafNode(serviceConfiguration, "news", "Node used for testing purposes", client);
        root.add(node);
    }
View Full Code Here

        // since we have no nodes, there should be no items.
        assertEquals(0, inner.size());
    }

    public void testSomeItems() throws Exception {
        root.add(new LeafNode(serviceConfiguration, "news", "News", client));
        root.add(new LeafNode(serviceConfiguration, "blogs", "Blogs", client));

        DefaultDiscoInfoStanzaGenerator sg = (DefaultDiscoInfoStanzaGenerator) getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService.getBareJID(), "id123");

        ResponseStanzaContainer result = sendStanza(stanza, true);
View Full Code Here

        assertNotNull(news);
        assertNotNull(blogs);
    }

    public void testNodeItemsNone() throws Exception {
        root.add(new LeafNode(serviceConfiguration, "news", "News", client));

        DefaultDiscoInfoStanzaGenerator sg = (DefaultDiscoInfoStanzaGenerator) getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService.getBareJID(), "id123", "news");

        ResponseStanzaContainer result = sendStanza(stanza, true);
View Full Code Here

        // since we have no messages, there should be no items.
        assertEquals(0, inner.size());
    }

    public void testNodeItemsSome() throws Exception {
        LeafNode node = new LeafNode(serviceConfiguration, "news", "News", client);
        root.add(node);

        XMLElement item1 = new XMLElement("namespace1", "item1", null, (Attribute[]) null, (XMLFragment[]) null);
        XMLElement item2 = new XMLElement("namespace2", "item2", null, (Attribute[]) null, (XMLFragment[]) null);
        XMLElement item3 = new XMLElement("namespace3", "item3", null, (Attribute[]) null, (XMLFragment[]) null);
        node.publish(client, relay, "itemid1", item1);
        Thread.sleep(10);
        node.publish(client, relay, "itemid2", item1); // publish this one with the same id as the next one (overwritten by the next)
        node.publish(client, relay, "itemid2", item2); // overwrite the prev. item (use the same itemid)
        Thread.sleep(10);
        node.publish(client, relay, "itemid3", item3);

        DefaultDiscoInfoStanzaGenerator sg = (DefaultDiscoInfoStanzaGenerator) getDefaultStanzaGenerator();
        Stanza stanza = sg.getStanza(client, pubsubService.getBareJID(), "id123", "news");

        ResponseStanzaContainer result = sendStanza(stanza, true);
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
        client2 = new EntityImpl("user1", "vysper.org", null);
        client3 = new EntityImpl("user2", "vysper.org", null);

        n1 = new LeafNode(serviceConfiguration, "Node1", "Node 1 used for testing purposes", client);
        n1.setAffiliation(client2, PubSubAffiliation.MEMBER);

        root.add(n1);
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.model.LeafNode

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.