collector_go/scheduler/scheduler_test.go
insanity@loafle.com e1a0fe961a collector-scheduler
2017-04-14 19:09:51 +09:00

36 lines
539 B
Go

package scheduler
import (
"fmt"
"strconv"
"testing"
"time"
)
func TestSchedul(t *testing.T) {
s := Scheduler{}
s.Init()
for i := 0; i < 10; i++ {
s.NewSchedule(strconv.Itoa(i), "3", test)
}
time.Sleep(time.Second * 10)
////update
fmt.Println("update")
for i := 0; i < 10; i++ {
s.UpdateSchedule(strconv.Itoa(i), "1")
}
time.Sleep(time.Second * 10)
//remove
fmt.Println("remove")
for i := 0; i < 9; i++ {
s.RemoveSchedule(strconv.Itoa(i))
}
time.Sleep(time.Second * 10)
}
func test() {
fmt.Println("test")
}