mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-04-02 05:03:18 +02:00
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:
parent
207c0aea02
commit
4519699dfa
1 changed files with 23 additions and 0 deletions
|
@ -55,6 +55,7 @@ package org.jivesoftware.smackx;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.jivesoftware.smack.SmackConfiguration;
|
import org.jivesoftware.smack.SmackConfiguration;
|
||||||
|
import org.jivesoftware.smack.XMPPException;
|
||||||
import org.jivesoftware.smack.test.SmackTestCase;
|
import org.jivesoftware.smack.test.SmackTestCase;
|
||||||
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
import org.jivesoftware.smackx.packet.DiscoverInfo;
|
||||||
import org.jivesoftware.smackx.packet.DiscoverItems;
|
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.
|
* Tests service discovery of XHTML support.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue