diff options
Diffstat (limited to 'Swiften/QA/ScriptedTests')
-rw-r--r-- | Swiften/QA/ScriptedTests/MultipleClients.lua | 6 | ||||
-rw-r--r-- | Swiften/QA/ScriptedTests/PubSub.lua | 38 | ||||
-rw-r--r-- | Swiften/QA/ScriptedTests/SConscript | 8 | ||||
-rw-r--r-- | Swiften/QA/ScriptedTests/SendMessage.lua | 6 |
4 files changed, 40 insertions, 18 deletions
diff --git a/Swiften/QA/ScriptedTests/MultipleClients.lua b/Swiften/QA/ScriptedTests/MultipleClients.lua index ddc7c44..ba29adb 100644 --- a/Swiften/QA/ScriptedTests/MultipleClients.lua +++ b/Swiften/QA/ScriptedTests/MultipleClients.lua @@ -1,7 +1,7 @@ -- --- Copyright (c) 2010-2013 Remko Tronçon --- Licensed under the GNU General Public License v3. --- See Documentation/Licenses/GPLv3.txt for more information. +-- Copyright (c) 2010-2013 Isode Limited. +-- All rights reserved.v3. +-- See the COPYING file for more information. -- require "sluift" diff --git a/Swiften/QA/ScriptedTests/PubSub.lua b/Swiften/QA/ScriptedTests/PubSub.lua index cb4679a..04a82ba 100644 --- a/Swiften/QA/ScriptedTests/PubSub.lua +++ b/Swiften/QA/ScriptedTests/PubSub.lua @@ -1,6 +1,6 @@ --[[ - Copyright (c) 2013 Remko Tronçon - Licensed under the GNU General Public License. + Copyright (c) 2013 Isode Limited. + All rights reserved. See the COPYING file for more information. --]] @@ -60,11 +60,15 @@ function test_entity_use_cases() -- 5.6 Subscriptions assert(node:create()) assert(subscriber_node:subscribe({ jid = subscriber_jid })) - local service_subscriptions = assert(pubsub:get_subscriptions()) - -- FIXME: Doesn't seem to return anything on M-Link. Test this later if this is supposed to work. - --print(service_subscriptions) - local node_subscriptions = assert(node:get_subscriptions()) - --print(node_subscriptions) + local service_subscriptions = assert(subscriber_pubsub:get_subscriptions()) + assert(#service_subscriptions == 1) + assert(service_subscriptions[1].node == node_id) + assert(service_subscriptions[1].jid == subscriber_jid) + assert(service_subscriptions[1].subscription == 'subscribed') + local node_subscriptions = assert(subscriber_node:get_subscriptions()) + assert(#node_subscriptions == 1) + assert(node_subscriptions[1].jid == subscriber_jid) + assert(node_subscriptions[1].subscription == 'subscribed') assert(node:delete()) -- 5.7 Retrieve affiliations @@ -282,7 +286,25 @@ function test_owner_use_cases() -- 8.7 Process pending subscription requests -- TODO - -- ... + -- 8.8 Manage Subscriptions + assert(node:create()) + assert(subscriber_node:subscribe({ jid = subscriber_jid })) + local items = assert(node:get_owner_subscriptions()) + assert(#items == 1) + assert(items[1].jid == subscriber_jid) + assert(items[1].subscription == "subscribed") + assert(node:delete()) + + -- 8.9 Manage Affiliations + assert(node:create()) + assert(node:set_owner_affiliations{affiliations = {{jid = subscriber_jid, type = 'publisher'}}}) + local items = assert(node:get_owner_affiliations()) + assert(#items == 2) + assert(items[1].jid == publisher_jid) + assert(items[1].type == "owner") + assert(items[2].jid == subscriber_jid) + assert(items[2].type == "publisher") + assert(node:delete()) end function run_tests() diff --git a/Swiften/QA/ScriptedTests/SConscript b/Swiften/QA/ScriptedTests/SConscript index 298c455..ae315fe 100644 --- a/Swiften/QA/ScriptedTests/SConscript +++ b/Swiften/QA/ScriptedTests/SConscript @@ -1,7 +1,7 @@ Import("env") if env["TEST"] : - env.ScriptTests([ - "SendMessage.lua", - "MultipleClients.lua", - ], "Swiften.QA.ScriptedTests", "system") + env.ScriptTests([ + "SendMessage.lua", + "MultipleClients.lua", + ], "Swiften.QA.ScriptedTests", "system") diff --git a/Swiften/QA/ScriptedTests/SendMessage.lua b/Swiften/QA/ScriptedTests/SendMessage.lua index 9623ef4..f6e5b00 100644 --- a/Swiften/QA/ScriptedTests/SendMessage.lua +++ b/Swiften/QA/ScriptedTests/SendMessage.lua @@ -1,7 +1,7 @@ -- --- Copyright (c) 2010-2013 Remko Tronçon --- Licensed under the GNU General Public License v3. --- See Documentation/Licenses/GPLv3.txt for more information. +-- Copyright (c) 2010-2013 Isode Limited. +-- All rights reserved.v3. +-- See the COPYING file for more information. -- require "sluift" |