summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-02-26 09:55:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-02-26 09:55:37 (GMT)
commite67eb946a93f2217291e1dd27e287e1b1f2f030a (patch)
tree19ac040223e833b25b8485055cf47eaf7179e4d8 /Sluift/client_test.lua
parentc2886c9ff6152130e2adb006f84268f972e629cc (diff)
downloadswift-contrib-e67eb946a93f2217291e1dd27e287e1b1f2f030a.zip
swift-contrib-e67eb946a93f2217291e1dd27e287e1b1f2f030a.tar.bz2
Moving tests around.
Diffstat (limited to 'Sluift/client_test.lua')
-rw-r--r--Sluift/client_test.lua38
1 files changed, 0 insertions, 38 deletions
diff --git a/Sluift/client_test.lua b/Sluift/client_test.lua
deleted file mode 100644
index 1652083..0000000
--- a/Sluift/client_test.lua
+++ /dev/null
@@ -1,38 +0,0 @@
-require "sluift"
-
--- sluift.debug = true
-client1_jid = os.getenv("SWIFT_CLIENTTEST_JID") .. "/Client1"
-client2_jid = os.getenv("SWIFT_CLIENTTEST_JID") .. "/Client2"
-password = os.getenv("SWIFT_CLIENTTEST_PASS")
-
-print "Connecting client 1"
-client1 = sluift.new_client(client1_jid, password)
-client1:connect()
-client1:send_presence("I'm here")
-
-print "Connecting client 2"
-client2 = sluift.new_client(client2_jid, password)
-client2:connect()
-client2:send_presence("I'm here")
-
-print "Checking version of client 2 from client 1"
-client2:set_version({name = "Sluift Test", version = "1.0"})
-client2_version = client1:get_version(client2_jid)
-assert(client2_version["name"] == "Sluift Test")
-assert(client2_version["version"] == "1.0")
-
-print "Sending message from client 1 to client 2"
-client1:send_message(client2_jid, "Hello")
-received_message = client2:for_event(function(event)
- if event["type"] == "message" and event["from"] == client1_jid then
- return event["body"]
- end
- end)
-assert(received_message == "Hello")
-
-print "Retrieving the roster"
-roster = client1:get_roster()
-table.foreach(roster, print)
-
-client1:disconnect()
-client2:disconnect()