Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Aug 11, 2013
1 parent 1154c59 commit d147e97
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions nsqd/stats_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package main

import (
"testing"
)

func TestStats(t *testing.T) {
log.SetOutput(ioutil.Discard)
defer log.SetOutput(os.Stdout)

options := NewNsqdOptions()
tcpAddr, _, nsqd := mustStartNSQd(options)
defer nsqd.Exit()

topicName := "test_stats" + strconv.Itoa(int(time.Now().Unix()))
topic := nsqd.GetTopic(topicName)
msg := nsq.NewMessage(<-nsqd.idChan, []byte("test body"))
topic.PutMessage(msg)

conn, err := mustConnectNSQd(tcpAddr)
assert.Equal(t, err, nil)

identify(t, conn)
sub(t, conn, topicName, "ch")

stats := nsqd.getStats()
assert.Equal(t, false, true)
}

0 comments on commit d147e97

Please sign in to comment.