Search in sources :

Example 16 with DiscoverItems

use of org.jivesoftware.smackx.packet.DiscoverItems in project Smack by igniterealtime.

the class EntityUseCases method testDiscoverNodeItems.

public void testDiscoverNodeItems() throws Exception {
    LeafNode myNode = getRandomPubnode(getManager(), true, false);
    myNode.send(new Item());
    myNode.send(new Item());
    myNode.send(new Item());
    myNode.send(new Item());
    DiscoverItems items = myNode.discoverItems();
    int count = 0;
    for (Iterator<DiscoverItems.Item> it = items.getItems(); it.hasNext(); it.next(), count++) ;
    assertEquals(4, count);
}
Also used : DiscoverItems(org.jivesoftware.smackx.packet.DiscoverItems)

Aggregations

DiscoverItems (org.jivesoftware.smackx.packet.DiscoverItems)16 ArrayList (java.util.ArrayList)6 XMPPException (org.jivesoftware.smack.XMPPException)6 ServiceDiscoveryManager (org.jivesoftware.smackx.ServiceDiscoveryManager)6 DiscoverInfo (org.jivesoftware.smackx.packet.DiscoverInfo)5 PacketIDFilter (org.jivesoftware.smack.filter.PacketIDFilter)2 Iterator (java.util.Iterator)1 XMPPConnection (org.jivesoftware.smack.XMPPConnection)1 PacketFilter (org.jivesoftware.smack.filter.PacketFilter)1 PacketTypeFilter (org.jivesoftware.smack.filter.PacketTypeFilter)1 IQ (org.jivesoftware.smack.packet.IQ)1 Packet (org.jivesoftware.smack.packet.Packet)1 XMPPError (org.jivesoftware.smack.packet.XMPPError)1 Form (org.jivesoftware.smackx.Form)1 FormField (org.jivesoftware.smackx.FormField)1 Identity (org.jivesoftware.smackx.packet.DiscoverInfo.Identity)1 Item (org.jivesoftware.smackx.packet.DiscoverItems.Item)1