data_sender_go/data_sender_test.go
insanity@loafle.com 87f6a06831 resend failed
2017-04-26 20:00:27 +09:00

39 lines
553 B
Go

package data_sender_go
import (
"fmt"
"loafle.com/overflow/agent_api/observer"
"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(observer.DATA_QUEUE.String(), cd)
}