mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-30 02:02:06 +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:
parent
ecadf0b4a8
commit
f1c38d67d7
1 changed files with 19 additions and 7 deletions
|
@ -122,14 +122,25 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
||||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(1), getFullJID(0)));
|
assertFalse(XHTMLManager.isServiceEnabled(getConnection(1), getFullJID(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Tests publishing items to another entity.
|
||||||
*/
|
*/
|
||||||
/*public void testPublishItems() {
|
/*public void testPublishItems() {
|
||||||
// TODO Remove this line when the "additional services for extensions" are
|
|
||||||
// implemented
|
|
||||||
new ServiceDiscoveryManager(getConnection(0));
|
|
||||||
|
|
||||||
DiscoverItems itemsToPublish = new DiscoverItems();
|
DiscoverItems itemsToPublish = new DiscoverItems();
|
||||||
DiscoverItems.Item itemToPublish = new DiscoverItems.Item("pubsub.shakespeare.lit");
|
DiscoverItems.Item itemToPublish = new DiscoverItems.Item("pubsub.shakespeare.lit");
|
||||||
itemToPublish.setName("Avatar");
|
itemToPublish.setName("Avatar");
|
||||||
|
@ -138,9 +149,10 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
||||||
itemsToPublish.addItem(itemToPublish);
|
itemsToPublish.addItem(itemToPublish);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ServiceDiscoveryManager.getInstanceFor(getConnection(0)).publishItems("host", itemsToPublish);
|
ServiceDiscoveryManager.getInstanceFor(getConnection(0)).publishItems(getHost(),
|
||||||
|
itemsToPublish);
|
||||||
}
|
}
|
||||||
catch (XMPPException e) {
|
catch (Exception e) {
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue