rebuild_test.go 424 B

123456789101112131415161718192021222324252627
  1. package service
  2. import (
  3. "flag"
  4. "testing"
  5. "go-common/app/job/main/spy/conf"
  6. "go-common/library/log"
  7. )
  8. func TestServiceReBuild(t *testing.T) {
  9. flag.Parse()
  10. if err := conf.Init(); err != nil {
  11. t.Errorf("conf.Init() error(%v)", err)
  12. t.FailNow()
  13. }
  14. log.Init(conf.Conf.Xlog)
  15. defer log.Close()
  16. if s == nil {
  17. s = New(conf.Conf)
  18. }
  19. testReBuild(t, s)
  20. }
  21. func testReBuild(t *testing.T, s *Service) {
  22. s.reBuild()
  23. }