summaryrefslogtreecommitdiffstats
path: root/xmppbot_test.go
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2015-07-02 12:47:49 -0400
committerBrian Cully <bjc@kublai.com>2015-07-02 12:47:49 -0400
commit55e4519bf06b3092666dc06fe0ddf2b50b8ba8f0 (patch)
tree73fc081ecc507348d01b7dc31b2aad924678814e /xmppbot_test.go
downloadxmppbot-55e4519bf06b3092666dc06fe0ddf2b50b8ba8f0.tar.gz
xmppbot-55e4519bf06b3092666dc06fe0ddf2b50b8ba8f0.zip
Initial commit.
Diffstat (limited to 'xmppbot_test.go')
-rw-r--r--xmppbot_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/xmppbot_test.go b/xmppbot_test.go
new file mode 100644
index 0000000..fbabd4c
--- /dev/null
+++ b/xmppbot_test.go
@@ -0,0 +1,28 @@
+package main
+
+import (
+ "testing"
+ "time"
+)
+
+const TIMEOUT = 10 * time.Second
+
+const JID = "xmppload0.reuters.com@array12.msgtst.reuters.com"
+const EMAIL_ADDR = "xmppload0@reuters.com"
+const PASSWORD = "Welcome1"
+const HOST = "localhost:5222"
+
+func TestConnect(t *testing.T) {
+ bot := NewBot(JID, PASSWORD, HOST, TIMEOUT)
+ if err := bot.Dial(); err != nil {
+ t.Fatalf("Couldn't connect: %s.", err)
+ }
+
+ if err := bot.Login(); err != nil {
+ t.Fatalf("Couldn't login bot: %s.", err)
+ }
+
+ if err := bot.Bind(); err != nil {
+ t.Fatalf("Couldn't bind to resource: %s.", err)
+ }
+}