event_sender_go/event_sender_test.go

37 lines
574 B
Go
Raw Normal View History

2017-04-27 09:58:50 +00:00
package event_sender
import (
"loafle.com/overflow/agent_api/observer"
"loafle.com/overflow/agent_api/observer/messages"
"log"
"testing"
"time"
)
func TestEventSender_Start(t *testing.T) {
es := &EventSender{}
es.Start()
testNotify()
time.Sleep(time.Second * 100)
}
func testNotify() {
//time.Sleep(time.Second * 5)
result := make(map[string]string)
result["ab"] = "123"
result["cd"] = "456"
result["ef"] = "789"
cd := &Data{
SensorId: "insanity",
Data: result,
}
log.Println("New data Notify")
observer.Notify(messages.QUEUE_EVENT, cd)
}