25 lines
557 B
Go
25 lines
557 B
Go
package system
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestCoreStart(t *testing.T) {
|
|
sys := New()
|
|
|
|
b1 := EasyBaseService{"b1", []string{}, true}
|
|
b2 := EasyBaseService{"b2", []string{"b1"}, true}
|
|
b3 := EasyBaseService{"b3", []string{"b1"}, true}
|
|
b4 := EasyBaseService{"b4", []string{"b3", "b6"}, true}
|
|
b5 := EasyBaseService{"b5", []string{"b4", "b1"}, true}
|
|
b6 := EasyBaseService{"b6", []string{"b1", "b2"}, true}
|
|
sys.Append(b1, b2, b3, b4, b5, b6)
|
|
|
|
go sys.Start()
|
|
time.Sleep(time.Second * 1)
|
|
sys.Stop()
|
|
<-sys.Done()
|
|
l.Debug().Msg("test finish")
|
|
}
|