service_test.go 455 B

123456789101112131415161718192021222324252627282930
  1. package service
  2. import (
  3. "flag"
  4. "fmt"
  5. "path/filepath"
  6. "testing"
  7. "go-common/app/job/main/history/conf"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. var s *Service
  11. func init() {
  12. dir, _ := filepath.Abs("../cmd/history-job-test.toml")
  13. flag.Set("conf", dir)
  14. err := conf.Init()
  15. if err != nil {
  16. fmt.Printf("conf.Init() error(%v)", err)
  17. }
  18. s = New(conf.Conf)
  19. }
  20. func Test_Ping(t *testing.T) {
  21. Convey("Test_Ping", t, func() {
  22. s.Ping()
  23. })
  24. }