Added test that ensures that Smack answers a 404 error when the disco#info includes a node. SMACK-8

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2403 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2004-10-31 03:37:05 +00:00 committed by gaston
parent 207c0aea02
commit 4519699dfa
1 changed files with 23 additions and 0 deletions

View File

@ -55,6 +55,7 @@ package org.jivesoftware.smackx;
import java.util.Iterator;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.test.SmackTestCase;
import org.jivesoftware.smackx.packet.DiscoverInfo;
import org.jivesoftware.smackx.packet.DiscoverItems;
@ -102,6 +103,28 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
}
}
/**
* Tests that ensures that Smack answers a 404 error when the disco#info includes a node.
*/
public void testInfoWithNode() {
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager
.getInstanceFor(getConnection(0));
try {
// Discover the information of another Smack client
discoManager.discoverInfo(getFullJID(1), "some node");
// Check the identity of the Smack client
fail("Unexpected identities were returned instead of a 404 error");
}
catch (XMPPException e) {
assertEquals("Incorrect error", 404, e.getXMPPError().getCode());
}
catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}
/**
* Tests service discovery of XHTML support.
*/