data_sender_go/data_sender_test.go
insanity@loafle.com 048a8e70ca data_sender
2017-04-26 18:07:44 +09:00

40 lines
591 B
Go

package data_sender_go
import (
"fmt"
"loafle.com/overflow/agent_api/observer"
"loafle.com/overflow/queue_go"
"testing"
"time"
)
type Result struct {
Data []byte
}
func TestSend(t *testing.T) {
ds := &DataSender{}
ds.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,
}
fmt.Println("New data Notify")
observer.Notify(queue.StringType(queue.EVENT_TYPE), cd)
}