QuitService->BaseService

This commit is contained in:
Jae Kwon
2016-10-28 12:09:22 -07:00
parent 44f2818a3d
commit 2781df39e5
2 changed files with 38 additions and 15 deletions

24
service_test.go Normal file
View File

@ -0,0 +1,24 @@
package common
import (
"testing"
)
func TestBaseServiceWait(t *testing.T) {
type TestService struct {
BaseService
}
ts := &TestService{}
ts.BaseService = *NewBaseService(nil, "TestService", ts)
ts.Start()
go func() {
ts.Stop()
}()
for i := 0; i < 10; i++ {
ts.Wait()
}
}