mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +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
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue