1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-27 06:38:01 +01:00

Adds new test for discovering if a server supports publishing of items. SMACK-150

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2351 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2004-08-05 16:57:57 +00:00 committed by gdombiak
parent ecadf0b4a8
commit f1c38d67d7

View file

@ -123,13 +123,24 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
}
/**
* Tests publishing items to another entity.
* Tests support for publishing items to another entity.
*/
public void testDiscoverPublishItemsSupport() {
try {
boolean canPublish = ServiceDiscoveryManager.getInstanceFor(getConnection(0))
.canPublishItems(getHost());
assertFalse("Messenger does not support publishing...so far!!", canPublish);
}
catch (Exception e) {
fail(e.getMessage());
}
}
/**
* Tests publishing items to another entity.
*/
/*public void testPublishItems() {
// TODO Remove this line when the "additional services for extensions" are
// implemented
new ServiceDiscoveryManager(getConnection(0));
DiscoverItems itemsToPublish = new DiscoverItems();
DiscoverItems.Item itemToPublish = new DiscoverItems.Item("pubsub.shakespeare.lit");
itemToPublish.setName("Avatar");
@ -138,9 +149,10 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
itemsToPublish.addItem(itemToPublish);
try {
ServiceDiscoveryManager.getInstanceFor(getConnection(0)).publishItems("host", itemsToPublish);
ServiceDiscoveryManager.getInstanceFor(getConnection(0)).publishItems(getHost(),
itemsToPublish);
}
catch (XMPPException e) {
catch (Exception e) {
fail(e.getMessage());
}